diff -Nru abiword-2.6.2/abiword/abiword.desktop abiword-2.6.4/abiword/abiword.desktop --- abiword-2.6.2/abiword/abiword.desktop 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/abiword/abiword.desktop 2008-07-13 14:11:02.000000000 +0100 @@ -1,17 +1,16 @@ [Desktop Entry] -Version=1.0 -Encoding=UTF-8 -Name=AbiWord Exec=abiword Icon=abiword_48 Terminal=false Type=Application Categories=Application;Office;WordProcessor;GNOME;GTK;X-Red-Hat-Base; StartupNotify=true +Encoding=UTF-8 X-Desktop-File-Install-Version=0.9 MimeType=application/x-abiword;text/x-abiword;text/x-xml-abiword;text/plain;application/msword;application/rtf;application/vnd.plain;application/xhtml+xml;text/html;application/x-crossmark;application/docbook+xml;application/x-t602;application/vnd.oasis.opendocument.text;application/vnd.sun.xml.writer;application/vnd.stardivision.writer;text/vnd.wap.wml;application/wordperfect6;application/wordperfect5.1; +Name=AbiWord GenericName=Word Processor -Comment=AbiWord Word Processor +Comment=Compose, edit, and view documents Name[de]=Textverarbeitung Comment[de]=AbiWord Textverarbeitung Name[nb]=Tekstbehandling @@ -34,4 +33,3 @@ Comment[pl]=Edytor tekstu AbiWord Name[ja]=AbiWord ワードプロセッサ Comment[ja]=AbiWord ワードプロセッサ -GenericName[en_US]=Word Processor diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/configure /tmp/qY2gb79Nml/abiword-2.6.4/abiword/configure --- abiword-2.6.2/abiword/configure 2008-04-06 22:26:22.000000000 +0100 +++ abiword-2.6.4/abiword/configure 2008-07-13 14:12:32.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for abiword 2.6.2. +# Generated by GNU Autoconf 2.61 for abiword 2.6.4. # # Report bugs to . # @@ -574,8 +574,8 @@ # Identity of this package. PACKAGE_NAME='abiword' PACKAGE_TARNAME='abiword' -PACKAGE_VERSION='2.6.2' -PACKAGE_STRING='abiword 2.6.2' +PACKAGE_VERSION='2.6.4' +PACKAGE_STRING='abiword 2.6.4' PACKAGE_BUGREPORT='http://www.abisource.com/' ac_unique_file="src/af/ev/xp/ev_Menu.h" @@ -1447,7 +1447,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures abiword 2.6.2 to adapt to many kinds of systems. +\`configure' configures abiword 2.6.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1517,7 +1517,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of abiword 2.6.2:";; + short | recursive ) echo "Configuration of abiword 2.6.4:";; esac cat <<\_ACEOF @@ -1724,7 +1724,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -abiword configure 2.6.2 +abiword configure 2.6.4 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1738,7 +1738,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by abiword $as_me 2.6.2, which was +It was created by abiword $as_me 2.6.4, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2429,7 +2429,7 @@ # Define the identity of the package. PACKAGE='abiword' - VERSION='2.6.2' + VERSION='2.6.4' cat >>confdefs.h <<_ACEOF @@ -17417,7 +17417,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by abiword $as_me 2.6.2, which was +This file was extended by abiword $as_me 2.6.4, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17464,7 +17464,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -abiword config.status 2.6.2 +abiword config.status 2.6.4 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/configure.ac /tmp/qY2gb79Nml/abiword-2.6.4/abiword/configure.ac --- abiword-2.6.2/abiword/configure.ac 2008-04-06 22:22:51.000000000 +0100 +++ abiword-2.6.4/abiword/configure.ac 2008-07-13 14:11:02.000000000 +0100 @@ -24,7 +24,7 @@ m4_define([abiword_version_major], [2]) m4_define([abiword_version_minor], [6]) -m4_define([abiword_version_micro], [2]) +m4_define([abiword_version_micro], [4]) m4_define([abiword_series], [abiword_version_major.abiword_version_minor]) m4_define([abiword_version], [abiword_version_major.abiword_version_minor.abiword_version_micro]) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword/Makefile --- abiword-2.6.2/abiword/Makefile 2008-04-06 16:59:28.000000000 +0100 +++ abiword-2.6.4/abiword/Makefile 2008-07-13 14:11:02.000000000 +0100 @@ -109,9 +109,15 @@ distribution: compile canonical $(MAKE) ABI_ROOT=$(ABI_ROOT) prefix=$(prefix) -C src distribution +toolsplugins: + $(MAKE) ABI_ROOT=$(ABI_ROOT) prefix=$(prefix) -C src toolsplugins + disttools: $(MAKE) ABI_ROOT=$(ABI_ROOT) prefix=$(prefix) -C src disttools +impexpplugins: + $(MAKE) ABI_ROOT=$(ABI_ROOT) prefix=$(prefix) -C src impexpplugins + distimpexp: $(MAKE) ABI_ROOT=$(ABI_ROOT) prefix=$(prefix) -C src distimpexp ################################################################## diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/po/abiword.pot /tmp/qY2gb79Nml/abiword-2.6.4/abiword/po/abiword.pot --- abiword-2.6.2/abiword/po/abiword.pot 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/abiword/po/abiword.pot 1970-01-01 01:00:00.000000000 +0100 @@ -1,8256 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-04-07 01:06+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#. -#. * Translatable strings file generated by extract-ui. -#. * DO NOT compile this file as part of your application. -#. -#. MENU_LABEL__BOGUS1__ -#. MENU_LABEL__BOGUS2__ -#. MENU_STATUSLINE__BOGUS1__ -#. MENU_STATUSLINE__BOGUS2__ -#. MENU_STATUSLINE_OPEN_TEMPLATE -#. MENU_STATUSLINE_FILE -#. MENU_STATUSLINE_EDIT -#. MENU_STATUSLINE_VIEW -#. MENU_STATUSLINE_VIEW_TOOLBARS -#. MENU_STATUSLINE_INSERT -#. MENU_STATUSLINE_FORMAT -#. MENU_STATUSLINE_FMT -#. MENU_STATUSLINE_TOOLS -#. MENU_STATUSLINE_TOOLS_SPELLING -#. MENU_STATUSLINE_ALIGN -#. MENU_STATUSLINE_WINDOW -#. MENU_STATUSLINE_HELP -#: po/tmp/ap_String_Id.h.h:23 -msgid " " -msgstr "" - -#. DLG_Styles_ErrNotTitle2 -#: po/tmp/ap_String_Id.h.h:25 -msgid "" -" - Reserved. \n" -" You cannot use this name. Choose Another \n" -msgstr "" - -#. DLG_WordCount_Auto_Update -#: po/tmp/ap_String_Id.h.h:27 -msgid " Auto Update" -msgstr "" - -#. DLG_PageSetup_Percent -#: po/tmp/ap_String_Id.h.h:29 -#, c-format -msgid "% of normal size" -msgstr "" - -#. MENU_LABEL_SPELL_SUGGEST_1 -#. MENU_LABEL_SPELL_SUGGEST_2 -#. MENU_LABEL_SPELL_SUGGEST_3 -#. MENU_LABEL_SPELL_SUGGEST_4 -#. MENU_LABEL_SPELL_SUGGEST_5 -#. MENU_LABEL_SPELL_SUGGEST_6 -#. MENU_LABEL_SPELL_SUGGEST_7 -#. MENU_LABEL_SPELL_SUGGEST_8 -#. MENU_LABEL_SPELL_SUGGEST_9 -#: po/tmp/ap_String_Id.h.h:39 -#, c-format -msgid "%s" -msgstr "" - -#. MSG_DlgNotImp -#: po/tmp/ap_String_Id.h.h:41 -#, c-format -msgid "" -"%s not implemented yet.\n" -"\n" -"If you are a programmer, feel free to add code in %s, line %d\n" -"and mail patches to:\n" -"\n" -"\tabiword-dev@abisource.com\n" -"\n" -"Otherwise, please be patient." -msgstr "" - -#. MENU_LABEL_FILE_RECENT_1 -#. MENU_LABEL_VIEW_TB_1 -#. MENU_LABEL_WINDOW_1 -#: po/tmp/ap_String_Id.h.h:45 -#, c-format -msgid "&1 %s" -msgstr "" - -#. DLG_Tab_Radio_None -#: po/tmp/ap_String_Id.h.h:47 -msgid "&1 None" -msgstr "" - -#. MENU_LABEL_FILE_RECENT_2 -#. MENU_LABEL_VIEW_TB_2 -#. MENU_LABEL_WINDOW_2 -#: po/tmp/ap_String_Id.h.h:51 -#, c-format -msgid "&2 %s" -msgstr "" - -#. DLG_Tab_Radio_Dot -#: po/tmp/ap_String_Id.h.h:53 -msgid "&2 .........." -msgstr "" - -#. MENU_LABEL_FILE_RECENT_3 -#. MENU_LABEL_VIEW_TB_3 -#. MENU_LABEL_WINDOW_3 -#: po/tmp/ap_String_Id.h.h:57 -#, c-format -msgid "&3 %s" -msgstr "" - -#. DLG_Tab_Radio_Dash -#: po/tmp/ap_String_Id.h.h:59 -msgid "&3 ----------" -msgstr "" - -#. MENU_LABEL_FILE_RECENT_4 -#. MENU_LABEL_VIEW_TB_4 -#. MENU_LABEL_WINDOW_4 -#: po/tmp/ap_String_Id.h.h:63 -#, c-format -msgid "&4 %s" -msgstr "" - -#. DLG_Tab_Radio_Underline -#: po/tmp/ap_String_Id.h.h:65 -msgid "&4 __________" -msgstr "" - -#. MENU_LABEL_FILE_RECENT_5 -#. MENU_LABEL_WINDOW_5 -#: po/tmp/ap_String_Id.h.h:68 -#, c-format -msgid "&5 %s" -msgstr "" - -#. MENU_LABEL_FILE_RECENT_6 -#. MENU_LABEL_WINDOW_6 -#: po/tmp/ap_String_Id.h.h:71 -#, c-format -msgid "&6 %s" -msgstr "" - -#. MENU_LABEL_FILE_RECENT_7 -#. MENU_LABEL_WINDOW_7 -#: po/tmp/ap_String_Id.h.h:74 -#, c-format -msgid "&7 %s" -msgstr "" - -#. MENU_LABEL_FILE_RECENT_8 -#. MENU_LABEL_WINDOW_8 -#: po/tmp/ap_String_Id.h.h:77 -#, c-format -msgid "&8 %s" -msgstr "" - -#. MENU_LABEL_FILE_RECENT_9 -#. MENU_LABEL_WINDOW_9 -#: po/tmp/ap_String_Id.h.h:80 -#, c-format -msgid "&9 %s" -msgstr "" - -#. MENU_LABEL_HELP_ABOUT -#: po/tmp/ap_String_Id.h.h:82 -#, c-format -msgid "&About %s" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_ACCEPT_REVISION -#: po/tmp/ap_String_Id.h.h:84 -msgid "&Accept revision" -msgstr "" - -#. DLG_Spell_AddToDict -#. MENU_LABEL_SPELL_ADD -#: po/tmp/ap_String_Id.h.h:87 -msgid "&Add" -msgstr "" - -#. DLG_PageSetup_Adjust -#: po/tmp/ap_String_Id.h.h:89 -msgid "&Adjust to:" -msgstr "" - -#. MENU_LABEL_ALIGN -#: po/tmp/ap_String_Id.h.h:91 -msgid "&Align" -msgstr "" - -#. DLG_Options_Label_ViewAll -#: po/tmp/ap_String_Id.h.h:93 -msgid "&All" -msgstr "" - -#. DLG_ApplyButton -#: po/tmp/ap_String_Id.h.h:95 -msgid "&Apply" -msgstr "" - -#. DLG_Para_LabelAt -#: po/tmp/ap_String_Id.h.h:97 -msgid "&At:" -msgstr "" - -#. MENU_LABEL_TOOLS_AUTOSPELL -#: po/tmp/ap_String_Id.h.h:99 -msgid "&Auto Spellcheck" -msgstr "" - -#. MENU_LABEL_TABLE_AUTOFIT -#: po/tmp/ap_String_Id.h.h:101 -msgid "&Autofit Table" -msgstr "" - -#. DLG_Options_Label_PrefsAutoSave -#: po/tmp/ap_String_Id.h.h:103 -msgid "&Automatically save this Scheme" -msgstr "" - -#. DLG_DateTime_AvailableFormats -#: po/tmp/ap_String_Id.h.h:105 -msgid "&Available formats:" -msgstr "" - -#. DLG_Para_LabelBefore -#: po/tmp/ap_String_Id.h.h:107 -msgid "&Before:" -msgstr "" - -#. MENU_LABEL_FMT_BOLD -#: po/tmp/ap_String_Id.h.h:109 -msgid "&Bold" -msgstr "" - -#. DLG_PageSetup_Bottom -#: po/tmp/ap_String_Id.h.h:111 -msgid "&Bottom:" -msgstr "" - -#. MENU_LABEL_INSERT_BREAK -#: po/tmp/ap_String_Id.h.h:113 -msgid "&Break" -msgstr "" - -#. MENU_LABEL_TABLE_SELECT_CELL -#: po/tmp/ap_String_Id.h.h:115 -msgid "&Cell" -msgstr "" - -#. MENU_LABEL_TABLE_INSERT_CELLS -#. MENU_LABEL_TABLE_DELETE_CELLS -#: po/tmp/ap_String_Id.h.h:118 -msgid "&Cells" -msgstr "" - -#. MENU_LABEL_ALIGN_CENTER -#: po/tmp/ap_String_Id.h.h:120 -msgid "&Center" -msgstr "" - -#. DLG_Spell_Change -#: po/tmp/ap_String_Id.h.h:122 -msgid "&Change" -msgstr "" - -#. MENU_LABEL_INSERT_CLIPART -#: po/tmp/ap_String_Id.h.h:124 -msgid "&Clip Art" -msgstr "" - -#. DLG_CloseButton -#. MENU_LABEL_FILE_CLOSE -#: po/tmp/ap_String_Id.h.h:127 -msgid "&Close" -msgstr "" - -#. MENU_LABEL_TABLE_DELETE_COLUMNS -#: po/tmp/ap_String_Id.h.h:129 -msgid "&Column" -msgstr "" - -#. DLG_Break_ColumnBreak -#: po/tmp/ap_String_Id.h.h:131 -msgid "&Column break" -msgstr "" - -#. MENU_LABEL_FMT_COLUMNS -#: po/tmp/ap_String_Id.h.h:133 -msgid "&Columns" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_COMPARE_DOCUMENTS -#: po/tmp/ap_String_Id.h.h:135 -msgid "&Compare documents" -msgstr "" - -#. MENU_LABEL_EDIT_COPY -#: po/tmp/ap_String_Id.h.h:137 -msgid "&Copy" -msgstr "" - -#. MENU_LABEL_FMT_STYLE_DEFINE -#: po/tmp/ap_String_Id.h.h:139 -msgid "&Create and Modify Styles" -msgstr "" - -#. DLG_Options_Label_PrefsCurrentScheme -#: po/tmp/ap_String_Id.h.h:141 -msgid "&Current Preferences Scheme" -msgstr "" - -#. MENU_LABEL_TABLE_DELETE -#: po/tmp/ap_String_Id.h.h:143 -msgid "&Delete" -msgstr "" - -#. MENU_LABEL_INSERT_DELETE_HYPERLINK -#: po/tmp/ap_String_Id.h.h:145 -msgid "&Delete hyperlink" -msgstr "" - -#. DLG_Options_Btn_CustomDict -#: po/tmp/ap_String_Id.h.h:147 -msgid "&Dictionary..." -msgstr "" - -#. MENU_LABEL_INSERT_DIRECTIONMARKER -#: po/tmp/ap_String_Id.h.h:149 -msgid "&Direction Marker" -msgstr "" - -#. MENU_LABEL_FMT_DOCUMENT -#: po/tmp/ap_String_Id.h.h:151 -msgid "&Document" -msgstr "" - -#. MENU_LABEL_TOOLS_HISTORY -#: po/tmp/ap_String_Id.h.h:153 -msgid "&Document History" -msgstr "" - -#. MENU_LABEL_WINDOW -#: po/tmp/ap_String_Id.h.h:155 -msgid "&Documents" -msgstr "" - -#. DLG_Para_PushNoHyphenate -#: po/tmp/ap_String_Id.h.h:157 -msgid "&Don't hyphenate" -msgstr "" - -#. DLG_Options_Btn_IgnoreEdit -#. MENU_LABEL_EDIT -#: po/tmp/ap_String_Id.h.h:160 -msgid "&Edit" -msgstr "" - -#. MENU_LABEL_INSERT_EDIT_HYPERLINK -#: po/tmp/ap_String_Id.h.h:162 -msgid "&Edit hyperlink" -msgstr "" - -#. DLG_Options_Label_SmartQuotesEnable -#: po/tmp/ap_String_Id.h.h:164 -msgid "&Enable smart quotes" -msgstr "" - -#. MENU_LABEL_INSERT_ENDNOTE -#: po/tmp/ap_String_Id.h.h:166 -msgid "&Endnote" -msgstr "" - -#. DLG_Break_EvenPage -#: po/tmp/ap_String_Id.h.h:168 -msgid "&Even page" -msgstr "" - -#. MENU_LABEL_INSERT_FIELD -#: po/tmp/ap_String_Id.h.h:170 -msgid "&Field" -msgstr "" - -#. DLG_Field_Fields_No_Colon -#: po/tmp/ap_String_Id.h.h:172 -msgid "&Fields" -msgstr "" - -#. DLG_Field_Fields -#: po/tmp/ap_String_Id.h.h:174 -msgid "&Fields:" -msgstr "" - -#. MENU_LABEL_FILE -#: po/tmp/ap_String_Id.h.h:176 -msgid "&File" -msgstr "" - -#. DLG_Options_Label_FileExtension -#: po/tmp/ap_String_Id.h.h:178 -msgid "&File extension:" -msgstr "" - -#. MENU_LABEL_EDIT_FIND -#: po/tmp/ap_String_Id.h.h:180 -msgid "&Find" -msgstr "" - -#. DLG_FR_FindNextButton -#: po/tmp/ap_String_Id.h.h:182 -msgid "&Find Next" -msgstr "" - -#. MENU_LABEL_FMT_FONT -#: po/tmp/ap_String_Id.h.h:184 -msgid "&Font" -msgstr "" - -#. DLG_PageSetup_Footer -#: po/tmp/ap_String_Id.h.h:186 -msgid "&Footer:" -msgstr "" - -#. MENU_LABEL_TABLE_FORMAT -#: po/tmp/ap_String_Id.h.h:188 -msgid "&Format Table" -msgstr "" - -#. MENU_LABEL_EDIT_GOTO -#: po/tmp/ap_String_Id.h.h:190 -msgid "&Go To" -msgstr "" - -#. DLG_FormatTOC_HasHeading -#: po/tmp/ap_String_Id.h.h:192 -msgid "&Has Heading" -msgstr "" - -#. MENU_LABEL_VIEW_HEADFOOT -#: po/tmp/ap_String_Id.h.h:194 -msgid "&Header and Footer" -msgstr "" - -#. DLG_PageSetup_Header -#: po/tmp/ap_String_Id.h.h:196 -msgid "&Header:" -msgstr "" - -#. DLG_PageSetup_Height -#: po/tmp/ap_String_Id.h.h:198 -msgid "&Height:" -msgstr "" - -#. DLG_HelpButton -#. MENU_LABEL_HELP -#: po/tmp/ap_String_Id.h.h:201 -msgid "&Help" -msgstr "" - -#. DLG_Options_Label_ViewHiddenText -#: po/tmp/ap_String_Id.h.h:203 -msgid "&Hidden Text" -msgstr "" - -#. DLG_Options_Label_SpellHighlightMisspelledWords -#: po/tmp/ap_String_Id.h.h:205 -msgid "&Highlight misspelled words" -msgstr "" - -#. MENU_LABEL_INSERT_HYPERLINK -#: po/tmp/ap_String_Id.h.h:207 -msgid "&Hyperlink" -msgstr "" - -#. DLG_Spell_Ignore -#: po/tmp/ap_String_Id.h.h:209 -msgid "&Ignore" -msgstr "" - -#. MENU_LABEL_SPELL_IGNOREALL -#: po/tmp/ap_String_Id.h.h:211 -msgid "&Ignore All" -msgstr "" - -#. MENU_LABEL_FMT_IMAGE -#. MENU_LABEL_FMT_POSIMAGE -#: po/tmp/ap_String_Id.h.h:214 -msgid "&Image" -msgstr "" - -#. MENU_LABEL_FILE_IMPORTSTYLES -#: po/tmp/ap_String_Id.h.h:216 -msgid "&Import Styles" -msgstr "" - -#. MENU_LABEL_WEB_WEBPREVIEW -#: po/tmp/ap_String_Id.h.h:218 -msgid "&In web browser" -msgstr "" - -#. DLG_FormatTOC_InheritLabel -#: po/tmp/ap_String_Id.h.h:220 -msgid "&Inherit label" -msgstr "" - -#. DLG_InsertButton -#. MENU_LABEL_INSERT -#. MENU_LABEL_TABLE_INSERT -#. DLG_Insert -#: po/tmp/ap_String_Id.h.h:224 po/tmp/xap_String_Id.h.h:15 -msgid "&Insert" -msgstr "" - -#. DLG_Options_Label_AutoSaveInterval -#: po/tmp/ap_String_Id.h.h:226 -msgid "&Interval:" -msgstr "" - -#. MENU_LABEL_FMT_ITALIC -#: po/tmp/ap_String_Id.h.h:228 -msgid "&Italic" -msgstr "" - -#. MENU_LABEL_INSERT_GOTO_HYPERLINK -#: po/tmp/ap_String_Id.h.h:230 -msgid "&Jump to hyperlink" -msgstr "" - -#. MENU_LABEL_ALIGN_JUSTIFY -#: po/tmp/ap_String_Id.h.h:232 -msgid "&Justify" -msgstr "" - -#. DLG_Para_PushKeepLinesTogether -#: po/tmp/ap_String_Id.h.h:234 -msgid "&Keep lines together" -msgstr "" - -#. MENU_LABEL_INSERT_DIRECTIONMARKER_LRM -#: po/tmp/ap_String_Id.h.h:236 -msgid "&LRM" -msgstr "" - -#. DLG_PageSetup_Landscape -#: po/tmp/ap_String_Id.h.h:238 -msgid "&Landscape" -msgstr "" - -#. MENU_LABEL_TOOLS_LANGUAGE -#: po/tmp/ap_String_Id.h.h:240 -msgid "&Language" -msgstr "" - -#. MENU_LABEL_ALIGN_LEFT -#: po/tmp/ap_String_Id.h.h:242 -msgid "&Left" -msgstr "" - -#. MENU_LABEL_FMT_DIRECTION_DO_LTR -#: po/tmp/ap_String_Id.h.h:244 -msgid "&Left-to-right text" -msgstr "" - -#. DLG_Para_LabelLeft -#. DLG_PageSetup_Left -#: po/tmp/ap_String_Id.h.h:247 -msgid "&Left:" -msgstr "" - -#. MENU_LABEL_VIEW_LOCK_TB_LAYOUT -#: po/tmp/ap_String_Id.h.h:249 -msgid "&Lock layout" -msgstr "" - -#. MENU_LABEL_TOOLS_MAILMERGE -#: po/tmp/ap_String_Id.h.h:251 -msgid "&Mail Merge" -msgstr "" - -#. MENU_LABEL_INSERT_MAILMERGE -#: po/tmp/ap_String_Id.h.h:253 -msgid "&Mail Merge Field" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_AUTO -#: po/tmp/ap_String_Id.h.h:255 -msgid "&Maintain Full History" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_MARK -#: po/tmp/ap_String_Id.h.h:257 -msgid "&Mark revisions while typing" -msgstr "" - -#. DLG_FR_MatchCase -#: po/tmp/ap_String_Id.h.h:259 -msgid "&Match case" -msgstr "" - -#. MENU_LABEL_TABLE_MERGE_CELLS -#: po/tmp/ap_String_Id.h.h:261 -msgid "&Merge Cells" -msgstr "" - -#. MENU_LABEL_WINDOW_MORE -#: po/tmp/ap_String_Id.h.h:263 -msgid "&More Documents" -msgstr "" - -#. DLG_Goto_Label_Name -#: po/tmp/ap_String_Id.h.h:265 -msgid "&Name:" -msgstr "" - -#. MENU_LABEL_FILE_NEW -#: po/tmp/ap_String_Id.h.h:267 -msgid "&New" -msgstr "" - -#. MENU_LABEL_WINDOW_NEW -#: po/tmp/ap_String_Id.h.h:269 -msgid "&New Window" -msgstr "" - -#. MENU_LABEL_FILE_NEW_USING_TEMPLATE -#: po/tmp/ap_String_Id.h.h:271 -msgid "&New using Template" -msgstr "" - -#. DLG_Break_NextPage -#: po/tmp/ap_String_Id.h.h:273 -msgid "&Next page" -msgstr "" - -#. MENU_LABEL_VIEW_NORMAL -#: po/tmp/ap_String_Id.h.h:275 -msgid "&Normal Layout" -msgstr "" - -#. DLG_Goto_Label_Number -#: po/tmp/ap_String_Id.h.h:277 -msgid "&Number:" -msgstr "" - -#. DLG_FormatTOC_NumberingType -#: po/tmp/ap_String_Id.h.h:279 -msgid "&Numbering type:" -msgstr "" - -#. DLG_Break_OddPage -#: po/tmp/ap_String_Id.h.h:281 -msgid "&Odd page" -msgstr "" - -#. MENU_LABEL_FILE_OPEN -#: po/tmp/ap_String_Id.h.h:283 -msgid "&Open" -msgstr "" - -#. DLG_MailMerge_OpenFile -#: po/tmp/ap_String_Id.h.h:285 -msgid "&Open File" -msgstr "" - -#. MENU_LABEL_FMT_OVERLINE -#: po/tmp/ap_String_Id.h.h:287 -msgid "&Overline" -msgstr "" - -#. MENU_LABEL_VIEW_ZOOM_WIDTH -#: po/tmp/ap_String_Id.h.h:289 -msgid "&Page Width" -msgstr "" - -#. DLG_Break_PageBreak -#: po/tmp/ap_String_Id.h.h:291 -msgid "&Page break" -msgstr "" - -#. DLG_FormatTOC_PageNumbering -#: po/tmp/ap_String_Id.h.h:293 -msgid "&Page numbering:" -msgstr "" - -#. MENU_LABEL_FMT_PARAGRAPH -#: po/tmp/ap_String_Id.h.h:295 -msgid "&Paragraph" -msgstr "" - -#. MENU_LABEL_EDIT_PASTE -#: po/tmp/ap_String_Id.h.h:297 -msgid "&Paste" -msgstr "" - -#. MENU_LABEL_INSERT_GRAPHIC -#: po/tmp/ap_String_Id.h.h:299 -msgid "&Picture" -msgstr "" - -#. MENU_LABEL_TOOLS_PLUGINS -#: po/tmp/ap_String_Id.h.h:301 -msgid "&Plugins" -msgstr "" - -#. DLG_PageSetup_Portrait -#: po/tmp/ap_String_Id.h.h:303 -msgid "&Portrait" -msgstr "" - -#. MENU_LABEL_FILE_PRINT -#: po/tmp/ap_String_Id.h.h:305 -msgid "&Print" -msgstr "" - -#. MENU_LABEL_VIEW_PRINT -#: po/tmp/ap_String_Id.h.h:307 -msgid "&Print Layout" -msgstr "" - -#. MENU_LABEL_TOOLS_HISTORY_PURGE -#: po/tmp/ap_String_Id.h.h:309 -msgid "&Purge History" -msgstr "" - -#. MENU_LABEL_FILE_EXIT -#: po/tmp/ap_String_Id.h.h:311 -msgid "&Quit" -msgstr "" - -#. MENU_LABEL_INSERT_DIRECTIONMARKER_RLM -#: po/tmp/ap_String_Id.h.h:313 -msgid "&RLM" -msgstr "" - -#. MENU_LABEL_EDIT_REDO -#: po/tmp/ap_String_Id.h.h:315 -msgid "&Redo" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_REJECT_REVISION -#: po/tmp/ap_String_Id.h.h:317 -msgid "&Reject revision" -msgstr "" - -#. DLG_FR_ReplaceButton -#: po/tmp/ap_String_Id.h.h:319 -msgid "&Replace" -msgstr "" - -#. DLG_Options_Btn_IgnoreReset -#: po/tmp/ap_String_Id.h.h:321 -msgid "&Reset" -msgstr "" - -#. MENU_LABEL_VIEW_DEFAULT_TB_LAYOUT -#: po/tmp/ap_String_Id.h.h:323 -msgid "&Reset to default layout" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS -#: po/tmp/ap_String_Id.h.h:325 -msgid "&Revisions" -msgstr "" - -#. MENU_LABEL_ALIGN_RIGHT -#: po/tmp/ap_String_Id.h.h:327 -msgid "&Right" -msgstr "" - -#. MENU_LABEL_FMT_DIRECTION_DO_RTL -#: po/tmp/ap_String_Id.h.h:329 -msgid "&Right-to-left text" -msgstr "" - -#. DLG_Para_LabelRight -#. DLG_PageSetup_Right -#: po/tmp/ap_String_Id.h.h:332 -msgid "&Right:" -msgstr "" - -#. MENU_LABEL_TABLE_DELETE_ROWS -#. MENU_LABEL_TABLE_SELECT_ROW -#: po/tmp/ap_String_Id.h.h:335 -msgid "&Row" -msgstr "" - -#. DLG_Options_Label_ViewRuler -#: po/tmp/ap_String_Id.h.h:337 -msgid "&Ruler" -msgstr "" - -#. MENU_LABEL_FILE_SAVE -#: po/tmp/ap_String_Id.h.h:339 -msgid "&Save" -msgstr "" - -#. MENU_LABEL_FILE_SAVEIMAGE -#: po/tmp/ap_String_Id.h.h:341 -msgid "&Save Image As" -msgstr "" - -#. MENU_LABEL_WEB_SAVEASWEB -#: po/tmp/ap_String_Id.h.h:343 -msgid "&Save web page" -msgstr "" - -#. MENU_LABEL_HELP_SEARCH -#: po/tmp/ap_String_Id.h.h:345 -msgid "&Search for Help" -msgstr "" - -#. MENU_LABEL_TABLE_SELECT -#: po/tmp/ap_String_Id.h.h:347 -msgid "&Select" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_SET_VIEW_LEVEL -#: po/tmp/ap_String_Id.h.h:349 -msgid "&Select revision" -msgstr "" - -#. MENU_LABEL_TOOLS_HISTORY_SHOW -#: po/tmp/ap_String_Id.h.h:351 -msgid "&Show History" -msgstr "" - -#. MENU_LABEL_VIEW_STATUSBAR -#: po/tmp/ap_String_Id.h.h:353 -msgid "&Show Status Bar" -msgstr "" - -#. DLG_Para_LabelSpecial -#: po/tmp/ap_String_Id.h.h:355 -msgid "&Special:" -msgstr "" - -#. MENU_LABEL_TOOLS_SPELLING -#: po/tmp/ap_String_Id.h.h:357 -msgid "&Spelling" -msgstr "" - -#. DLG_FormatTOC_StartAt -#: po/tmp/ap_String_Id.h.h:359 -msgid "&Start at:" -msgstr "" - -#. DLG_Options_Label_ViewStatusBar -#: po/tmp/ap_String_Id.h.h:361 -msgid "&Status bar" -msgstr "" - -#. MENU_LABEL_FMT_SUBSCRIPT -#: po/tmp/ap_String_Id.h.h:363 -msgid "&Subscript" -msgstr "" - -#. DLG_Para_PushSuppressLineNumbers -#: po/tmp/ap_String_Id.h.h:365 -msgid "&Suppress line numbers" -msgstr "" - -#. DLG_FormatTOC_TabLeader -#: po/tmp/ap_String_Id.h.h:367 -msgid "&Tab leader:" -msgstr "" - -#. MENU_LABEL_TABLE_INSERT_TABLE -#. MENU_LABEL_TABLE_DELETE_TABLE -#. MENU_LABEL_TABLE_SELECT_TABLE -#: po/tmp/ap_String_Id.h.h:371 -msgid "&Table" -msgstr "" - -#. MENU_LABEL_FMT_TABS -#: po/tmp/ap_String_Id.h.h:373 -msgid "&Tabs" -msgstr "" - -#. DLG_Para_ButtonTabs -#: po/tmp/ap_String_Id.h.h:375 -msgid "&Tabs..." -msgstr "" - -#. MENU_LABEL_VIEW_TOOLBARS -#: po/tmp/ap_String_Id.h.h:377 -msgid "&Toolbars" -msgstr "" - -#. MENU_LABEL_TOOLS -#: po/tmp/ap_String_Id.h.h:379 -msgid "&Tools" -msgstr "" - -#. DLG_PageSetup_Top -#: po/tmp/ap_String_Id.h.h:381 -msgid "&Top:" -msgstr "" - -#. DLG_Field_Types_No_Colon -#: po/tmp/ap_String_Id.h.h:383 -msgid "&Types" -msgstr "" - -#. DLG_Field_Types -#: po/tmp/ap_String_Id.h.h:385 -msgid "&Types:" -msgstr "" - -#. MENU_LABEL_FMT_UNDERLINE -#: po/tmp/ap_String_Id.h.h:387 -msgid "&Underline" -msgstr "" - -#. MENU_LABEL_EDIT_UNDO -#: po/tmp/ap_String_Id.h.h:389 -msgid "&Undo" -msgstr "" - -#. DLG_Options_Label_ViewUnits -#. DLG_PageSetup_Units -#: po/tmp/ap_String_Id.h.h:392 -msgid "&Units:" -msgstr "" - -#. MENU_LABEL_VIEW -#. DLG_MW_ViewButton -#: po/tmp/ap_String_Id.h.h:394 po/tmp/xap_String_Id.h.h:21 -msgid "&View" -msgstr "" - -#. MENU_LABEL_VIEW_WEB -#: po/tmp/ap_String_Id.h.h:396 -msgid "&Web Layout" -msgstr "" - -#. MENU_LABEL_VIEW_ZOOM_WHOLE -#: po/tmp/ap_String_Id.h.h:398 -msgid "&Whole Page" -msgstr "" - -#. DLG_FR_WholeWord -#: po/tmp/ap_String_Id.h.h:400 -msgid "&Whole word" -msgstr "" - -#. DLG_Para_PushWidowOrphanControl -#: po/tmp/ap_String_Id.h.h:402 -msgid "&Widow/Orphan control" -msgstr "" - -#. DLG_PageSetup_Width -#: po/tmp/ap_String_Id.h.h:404 -msgid "&Width:" -msgstr "" - -#. MENU_LABEL_TOOLS_WORDCOUNT -#: po/tmp/ap_String_Id.h.h:406 -msgid "&Word Count" -msgstr "" - -#. MENU_LABEL_VIEW_ZOOM_MENU -#. MENU_LABEL_VIEW_ZOOM -#: po/tmp/ap_String_Id.h.h:409 -msgid "&Zoom" -msgstr "" - -#. DLG_ListRevisions_LevelZero -#: po/tmp/ap_String_Id.h.h:411 -msgid "(All revisions visible)" -msgstr "" - -#. DLG_Spell_NoSuggestions -#: po/tmp/ap_String_Id.h.h:413 -msgid "(no spelling suggestions)" -msgstr "" - -#. DLG_Para_SpecialNone -#: po/tmp/ap_String_Id.h.h:415 -msgid "(none)" -msgstr "" - -#. TOOLBAR_LABEL_1COLUMN -#. TOOLBAR_STATUSLINE_1COLUMN -#. TOOLBAR_TOOLTIP_1COLUMN -#: po/tmp/ap_String_Id.h.h:419 -msgid "1 Column" -msgstr "" - -#. TOOLBAR_LABEL_MIDDLE_SPACE -#: po/tmp/ap_String_Id.h.h:421 -msgid "1.5 Spacing" -msgstr "" - -#. DLG_Para_SpacingHalf -#: po/tmp/ap_String_Id.h.h:423 -msgid "1.5 lines" -msgstr "" - -#. TOOLBAR_STATUSLINE_MIDDLE_SPACE -#. TOOLBAR_TOOLTIP_MIDDLE_SPACE -#: po/tmp/ap_String_Id.h.h:426 -msgid "1.5 spacing" -msgstr "" - -#. TOOLBAR_LABEL_PARA_12BEFORE -#: po/tmp/ap_String_Id.h.h:428 -msgid "12 pt before" -msgstr "" - -#. TOOLBAR_LABEL_2COLUMN -#. TOOLBAR_STATUSLINE_2COLUMN -#. TOOLBAR_TOOLTIP_2COLUMN -#: po/tmp/ap_String_Id.h.h:432 -msgid "2 Columns" -msgstr "" - -#. TOOLBAR_LABEL_3COLUMN -#. TOOLBAR_STATUSLINE_3COLUMN -#. TOOLBAR_TOOLTIP_3COLUMN -#: po/tmp/ap_String_Id.h.h:436 -msgid "3 Columns" -msgstr "" - -#. DLG_Goto_Btn_Prev -#: po/tmp/ap_String_Id.h.h:438 -msgid "<< Prev" -msgstr "" - -#. MSG_Exception -#: po/tmp/ap_String_Id.h.h:440 -msgid "" -"A fatal error has just occurred. Abiword is going to shutdown.\n" -"The current document has been saved to disc with a \".saved\" extension." -msgstr "" - -#. DLG_Options_Label_SpellSuggest -#: po/tmp/ap_String_Id.h.h:442 -msgid "A&lways suggest corrections" -msgstr "" - -#. FIELD_DateTime_AMPM -#: po/tmp/ap_String_Id.h.h:444 -msgid "AM/PM" -msgstr "" - -#. MSG_IE_BogusDocument -#: po/tmp/ap_String_Id.h.h:446 -#, c-format -msgid "AbiWord cannot open %s. It appears to be an invalid document" -msgstr "" - -#. MSG_SpellSelectionDone -#: po/tmp/ap_String_Id.h.h:448 -msgid "AbiWord finished checking the selection." -msgstr "" - -#. DLG_FR_FinishedReplace -#: po/tmp/ap_String_Id.h.h:450 -#, c-format -msgid "" -"AbiWord has finished its search of the document and has made %d replacements." -msgstr "" - -#. DLG_FR_FinishedFind -#: po/tmp/ap_String_Id.h.h:452 -msgid "AbiWord has finished searching the document." -msgstr "" - -#. WINDOWS_COMCTL_WARNING -#: po/tmp/ap_String_Id.h.h:454 -msgid "" -"AbiWord is designed for a newer version of the system file COMCTL32.DLL\n" -"than the one currently on your system. (COMCTL32.DLL version 4.72 or newer)\n" -"A solution to this problem is explained in the FAQ on the AbiSource web " -"site\n" -"\n" -"\thttp://www.abisource.com\n" -"\n" -"You can use the program, but the toolbar may be missing." -msgstr "" - -#. WINDOWS_NEED_UNICOWS -#: po/tmp/ap_String_Id.h.h:456 -#, c-format -msgid "" -"AbiWord needs the file %s.dll\n" -"Please download and install it from http://www.microsoft.com/msdownload/" -"platformsdk/sdkupdate/psdkredist.htm" -msgstr "" - -#. MENU_LABEL_HELP_ABOUT_GNOMEOFFICE -#: po/tmp/ap_String_Id.h.h:458 -msgid "About G&NOME Office" -msgstr "" - -#. MENU_STATUSLINE_HELP_ABOUT_GNOMEOFFICE -#: po/tmp/ap_String_Id.h.h:460 -msgid "About the GNOME Office project" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_ACCEPT_REVISION -#: po/tmp/ap_String_Id.h.h:462 -msgid "Accept the suggested change" -msgstr "" - -#. TOOLBAR_STATUSLINE_ADD_COLUMN -#. TOOLBAR_TOOLTIP_ADD_COLUMN -#: po/tmp/ap_String_Id.h.h:465 -msgid "Add a column to this table after the current column" -msgstr "" - -#. TOOLBAR_STATUSLINE_ADD_ROW -#. TOOLBAR_TOOLTIP_ADD_ROW -#: po/tmp/ap_String_Id.h.h:468 -msgid "Add a row to this table after the current row" -msgstr "" - -#. MENU_STATUSLINE_FMT_BORDERS -#: po/tmp/ap_String_Id.h.h:470 -msgid "Add borders and shading to the selection" -msgstr "" - -#. TOOLBAR_LABEL_ADD_COLUMN -#: po/tmp/ap_String_Id.h.h:472 -msgid "Add column after" -msgstr "" - -#. MENU_STATUSLINE_FMT_BULLETS -#: po/tmp/ap_String_Id.h.h:474 -msgid "Add or modify bullets and numbering for selected paragraphs" -msgstr "" - -#. TOOLBAR_LABEL_ADD_ROW -#: po/tmp/ap_String_Id.h.h:476 -msgid "Add row after" -msgstr "" - -#. MENU_STATUSLINE_SPELL_ADD -#: po/tmp/ap_String_Id.h.h:478 -msgid "Add this word to the custom dictionary" -msgstr "" - -#. DLG_Styles_ModifyTemplate -#: po/tmp/ap_String_Id.h.h:480 -msgid "Add to template" -msgstr "" - -#. DLG_Para_LabelAfter -#: po/tmp/ap_String_Id.h.h:482 -msgid "Aft&er:" -msgstr "" - -#. DLG_Para_LabelAlignment -#: po/tmp/ap_String_Id.h.h:484 -msgid "Ali&gnment:" -msgstr "" - -#. DLG_Tab_Label_Alignment -#. DLG_PageNumbers_Alignment_No_Colon -#: po/tmp/ap_String_Id.h.h:487 -msgid "Alignment" -msgstr "" - -#. DLG_PageNumbers_Alignment -#: po/tmp/ap_String_Id.h.h:489 -msgid "Alignment:" -msgstr "" - -#. DLG_Styles_LBL_All -#. DLG_UP_All -#: po/tmp/ap_String_Id.h.h:491 po/tmp/xap_String_Id.h.h:51 -msgid "All" -msgstr "" - -#. DLG_Options_Label_CheckAllowCustomToolbars -#: po/tmp/ap_String_Id.h.h:493 -msgid "Allow Custom Toolbars" -msgstr "" - -#. MENU_STATUSLINE_VIEW_LOCKSTYLES -#: po/tmp/ap_String_Id.h.h:495 -msgid "Allow formatting using styles only" -msgstr "" - -#. DLG_Options_Label_CheckWhiteForTransparent -#: po/tmp/ap_String_Id.h.h:497 -msgid "Allow screen colors other than white" -msgstr "" - -#. MENU_LABEL_INSERT_ANNOTATION -#: po/tmp/ap_String_Id.h.h:499 -msgid "Annotation" -msgstr "" - -#. FIELD_Application -#: po/tmp/ap_String_Id.h.h:501 -msgid "Application" -msgstr "" - -#. DLG_Options_Label_AppStartup -#: po/tmp/ap_String_Id.h.h:503 -msgid "Application Startup" -msgstr "" - -#. DLG_Options_Btn_Apply -#. DLG_Apply -#: po/tmp/ap_String_Id.h.h:505 po/tmp/xap_String_Id.h.h:63 -msgid "Apply" -msgstr "" - -#. TOOLBAR_STATUSLINE_FMTPAINTER -#. TOOLBAR_TOOLTIP_FMTPAINTER -#: po/tmp/ap_String_Id.h.h:508 -msgid "Apply the previously copied paragraph formatting onto the selected text" -msgstr "" - -#. DLG_Lists_Apply_Current -#: po/tmp/ap_String_Id.h.h:510 -msgid "Apply to Current List" -msgstr "" - -#. DLG_FormatTable_Apply_To -#: po/tmp/ap_String_Id.h.h:512 -msgid "Apply to:" -msgstr "" - -#. DLG_Lists_Arabic_List -#: po/tmp/ap_String_Id.h.h:514 -msgid "Arabic List" -msgstr "" - -#. MSG_AutoRevisionOffWarning -#: po/tmp/ap_String_Id.h.h:516 -msgid "" -"Are you sure you do not want to maintain full history record? If you " -"proceed, you will not be able to restore earlier versions of this document." -msgstr "" - -#. DLG_Para_SpacingAtLeast -#: po/tmp/ap_String_Id.h.h:518 -msgid "At least" -msgstr "" - -#. DLG_Lists_Resume -#: po/tmp/ap_String_Id.h.h:520 -msgid "Attach to Previous List" -msgstr "" - -#. DLG_MetaData_Author_LBL -#. DLG_PLUGIN_MANAGER_AUTHOR -#: po/tmp/ap_String_Id.h.h:522 po/tmp/xap_String_Id.h.h:85 -msgid "Author:" -msgstr "" - -#. DLG_Options_Label_AutoSaveUnderline -#: po/tmp/ap_String_Id.h.h:524 -msgid "Auto &Save" -msgstr "" - -#. DLG_Options_Label_AutoSaveCurrent -#: po/tmp/ap_String_Id.h.h:526 -msgid "Auto &save current file every" -msgstr "" - -#. DLG_Options_Label_AutoSave -#: po/tmp/ap_String_Id.h.h:528 -msgid "Auto Save" -msgstr "" - -#. DLG_Options_Label_SpellAutoReplace -#: po/tmp/ap_String_Id.h.h:530 -msgid "Auto replace misspelled words" -msgstr "" - -#. DLG_InsertTable_AutoFit_Capital -#: po/tmp/ap_String_Id.h.h:532 -msgid "AutoFit Behavior" -msgstr "" - -#. DLG_InsertTable_AutoFit -#: po/tmp/ap_String_Id.h.h:534 -msgid "AutoFit behavior" -msgstr "" - -#. MENU_STATUSLINE_TABLE_AUTOFIT -#: po/tmp/ap_String_Id.h.h:536 -msgid "Autofit Table" -msgstr "" - -#. DLG_Options_Label_Grammar -#: po/tmp/ap_String_Id.h.h:538 -msgid "Automatic Grammar Checking" -msgstr "" - -#. DLG_InsertTable_AutoColSize -#: po/tmp/ap_String_Id.h.h:540 -msgid "Automatic column size" -msgstr "" - -#. DLG_Options_Label_CheckAutoLoadPlugins -#: po/tmp/ap_String_Id.h.h:542 -msgid "Automatically load all plugins found" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_AUTOSPELL -#: po/tmp/ap_String_Id.h.h:544 -msgid "Automatically spell-check the document" -msgstr "" - -#. DLG_Styles_ModifyAutomatic -#: po/tmp/ap_String_Id.h.h:546 -msgid "Automatically update" -msgstr "" - -#. MSG_AutoMerge -#: po/tmp/ap_String_Id.h.h:548 -msgid "Automerge" -msgstr "" - -#. DLG_MailMerge_AvailableFields -#: po/tmp/ap_String_Id.h.h:550 -msgid "Available Fields" -msgstr "" - -#. DLG_DateTime_AvailableFormats_Capital -#: po/tmp/ap_String_Id.h.h:552 -msgid "Available Formats" -msgstr "" - -#. DLG_Styles_Available -#: po/tmp/ap_String_Id.h.h:554 -msgid "Available Styles" -msgstr "" - -#. DLG_Para_LabelBy -#: po/tmp/ap_String_Id.h.h:556 -msgid "B&y:" -msgstr "" - -#. DLG_FormatFrame_Background -#. DLG_FormatTable_Background -#: po/tmp/ap_String_Id.h.h:559 -msgid "Background" -msgstr "" - -#. DLG_FormatFrame_Background_Color -#. DLG_FormatTable_Background_Color -#: po/tmp/ap_String_Id.h.h:562 -msgid "Background color:" -msgstr "" - -#. DLG_Tab_Radio_Bar -#: po/tmp/ap_String_Id.h.h:564 -msgid "Bar" -msgstr "" - -#. TabToggleBarTab -#: po/tmp/ap_String_Id.h.h:566 -msgid "Bar Tab" -msgstr "" - -#. DLG_Styles_ModifyBasedOn -#: po/tmp/ap_String_Id.h.h:568 -msgid "Based On:" -msgstr "" - -#. DLG_Options_Label_BiDiOptions -#: po/tmp/ap_String_Id.h.h:570 -msgid "Bi-Directional Options" -msgstr "" - -#. TOOLBAR_LABEL_FMT_BOLD -#. TOOLBAR_STATUSLINE_FMT_BOLD -#. TOOLBAR_TOOLTIP_FMT_BOLD -#. DLG_UFS_StyleBold -#: po/tmp/ap_String_Id.h.h:574 po/tmp/xap_String_Id.h.h:119 -msgid "Bold" -msgstr "" - -#. MENU_LABEL_INSERT_BOOKMARK -#: po/tmp/ap_String_Id.h.h:576 -msgid "Boo&kmark" -msgstr "" - -#. DLG_Goto_Target_Bookmark -#: po/tmp/ap_String_Id.h.h:578 -msgid "Bookmark" -msgstr "" - -#. MSG_BookmarkNotFound -#: po/tmp/ap_String_Id.h.h:580 -#, c-format -msgid "Bookmark \"%s\" was not found in this document." -msgstr "" - -#. DLG_FormatFrame_Border_Color -#. DLG_FormatTable_Border_Color -#: po/tmp/ap_String_Id.h.h:583 -msgid "Border color:" -msgstr "" - -#. DLG_FormatFrame_Borders -#. DLG_FormatTable_Borders -#: po/tmp/ap_String_Id.h.h:586 -msgid "Borders" -msgstr "" - -#. MENU_LABEL_FMT_BORDERS -#: po/tmp/ap_String_Id.h.h:588 -msgid "Borders and Shading" -msgstr "" - -#. BottomMarginStatus -#: po/tmp/ap_String_Id.h.h:590 -#, c-format -msgid "Bottom Margin [%s]" -msgstr "" - -#. MENU_LABEL_FMT_BOTTOMLINE -#. TOOLBAR_LABEL_FMT_BOTTOMLINE -#. TOOLBAR_STATUSLINE_FMT_BOTTOMLINE -#. TOOLBAR_TOOLTIP_FMT_BOTTOMLINE -#. DLG_UFS_BottomlineCheck -#: po/tmp/ap_String_Id.h.h:595 po/tmp/xap_String_Id.h.h:123 -msgid "Bottomline" -msgstr "" - -#. DLG_Lists_Box_List -#. STYLE_BOXLIST -#: po/tmp/ap_String_Id.h.h:597 po/tmp/xap_String_Id.h.h:125 -msgid "Box List" -msgstr "" - -#. FIELD_Application_BuildId -#: po/tmp/ap_String_Id.h.h:599 -msgid "Build Id." -msgstr "" - -#. FIELD_Application_Options -#: po/tmp/ap_String_Id.h.h:601 -msgid "Build Options" -msgstr "" - -#. FIELD_Application_Target -#: po/tmp/ap_String_Id.h.h:603 -msgid "Build Target" -msgstr "" - -#. DLG_Lists_Type_bullet -#: po/tmp/ap_String_Id.h.h:605 -msgid "Bullet" -msgstr "" - -#. DLG_Lists_Bullet_List -#. STYLE_BULLETLIST -#: po/tmp/ap_String_Id.h.h:607 po/tmp/xap_String_Id.h.h:133 -msgid "Bullet List" -msgstr "" - -#. TOOLBAR_LABEL_LISTS_BULLETS -#. TOOLBAR_STATUSLINE_LISTS_BULLETS -#. TOOLBAR_TOOLTIP_LISTS_BULLETS -#: po/tmp/ap_String_Id.h.h:611 -msgid "Bullets" -msgstr "" - -#. MENU_LABEL_FMT_BULLETS -#: po/tmp/ap_String_Id.h.h:613 -msgid "Bullets and &Numbering" -msgstr "" - -#. DLG_Options_Label_Look -#: po/tmp/ap_String_Id.h.h:615 -msgid "Button Style" -msgstr "" - -#. MENU_LABEL_FMT_TOGGLECASE -#: po/tmp/ap_String_Id.h.h:617 -msgid "C&hange Case" -msgstr "" - -#. MENU_LABEL_EDIT_COPY_HYPERLINK_LOCATION -#: po/tmp/ap_String_Id.h.h:619 -msgid "C&opy hyperlink location" -msgstr "" - -#. MENU_LABEL_HELP_CREDITS -#: po/tmp/ap_String_Id.h.h:621 -msgid "C&redits" -msgstr "" - -#. MSG_NoBreakInsideTable -#: po/tmp/ap_String_Id.h.h:623 -msgid "Can not insert a Break inside a table" -msgstr "" - -#. MSG_NoBreakInsideFrame -#: po/tmp/ap_String_Id.h.h:625 -msgid "Can not insert a Break inside a text box" -msgstr "" - -#. DLG_Styles_ErrStyleCantDelete -#: po/tmp/ap_String_Id.h.h:627 -msgid "Cannot delete this style" -msgstr "" - -#. DLG_Styles_ErrStyleBuiltin -#: po/tmp/ap_String_Id.h.h:629 -msgid "Cannot modify a builtin style" -msgstr "" - -#. PRINT_CANNOTSTARTPRINTJOB -#: po/tmp/ap_String_Id.h.h:631 -msgid "Cannot start print job" -msgstr "" - -#. DLG_MetaData_Category_LBL -#: po/tmp/ap_String_Id.h.h:633 -msgid "Category:" -msgstr "" - -#. DLG_Tab_Radio_Center -#. DLG_PageNumbers_Center -#. TOOLBAR_LABEL_ALIGN_CENTER -#: po/tmp/ap_String_Id.h.h:637 -msgid "Center" -msgstr "" - -#. TabToggleCenterTab -#: po/tmp/ap_String_Id.h.h:639 -msgid "Center Tab" -msgstr "" - -#. TOOLBAR_STATUSLINE_ALIGN_CENTER -#. TOOLBAR_TOOLTIP_ALIGN_CENTER -#: po/tmp/ap_String_Id.h.h:642 -msgid "Center alignment" -msgstr "" - -#. MENU_STATUSLINE_ALIGN_CENTER -#: po/tmp/ap_String_Id.h.h:644 -msgid "Center-align the paragraph" -msgstr "" - -#. DLG_Para_AlignCentered -#: po/tmp/ap_String_Id.h.h:646 -msgid "Centered" -msgstr "" - -#. DLG_Spell_ChangeTo -#: po/tmp/ap_String_Id.h.h:648 -msgid "Change &to:" -msgstr "" - -#. DLG_Spell_ChangeAll -#: po/tmp/ap_String_Id.h.h:650 -msgid "Change A&ll" -msgstr "" - -#. DLG_Background_Title -#: po/tmp/ap_String_Id.h.h:652 -msgid "Change Background Color" -msgstr "" - -#. DLG_ToggleCase_Title -#: po/tmp/ap_String_Id.h.h:654 -msgid "Change Case" -msgstr "" - -#. DLG_Lists_Cur_Change_Start -#: po/tmp/ap_String_Id.h.h:656 -msgid "" -"Change Current \n" -"List" -msgstr "" - -#. DLG_Background_TitleHighlight -#: po/tmp/ap_String_Id.h.h:658 -msgid "Change Highlight Color" -msgstr "" - -#. DLG_FormatTOC_ChangeStyle -#: po/tmp/ap_String_Id.h.h:660 -msgid "Change Style" -msgstr "" - -#. DLG_Background_TitleFore -#: po/tmp/ap_String_Id.h.h:662 -msgid "Change Text Color" -msgstr "" - -#. MENU_STATUSLINE_FMT_DIRECTION -#: po/tmp/ap_String_Id.h.h:664 -msgid "Change directional properties of text" -msgstr "" - -#. TOOLBAR_STATUSLINE_FMT_DOM_DIRECTION -#. TOOLBAR_TOOLTIP_FMT_DOM_DIRECTION -#: po/tmp/ap_String_Id.h.h:667 -msgid "Change dominant direction of paragraph" -msgstr "" - -#. MENU_STATUSLINE_FMT_TOGGLECASE -#: po/tmp/ap_String_Id.h.h:669 -msgid "Change the case of the selected text" -msgstr "" - -#. MENU_STATUSLINE_FMT_FONT -#: po/tmp/ap_String_Id.h.h:671 -msgid "Change the font of the selected text" -msgstr "" - -#. MENU_STATUSLINE_FMT_PARAGRAPH -#: po/tmp/ap_String_Id.h.h:673 -msgid "Change the format of the selected paragraph" -msgstr "" - -#. MENU_STATUSLINE_FMT_LANGUAGE -#. MENU_STATUSLINE_TOOLS_LANGUAGE -#: po/tmp/ap_String_Id.h.h:676 -msgid "Change the language of the selected text" -msgstr "" - -#. MENU_STATUSLINE_FMT_COLUMNS -#: po/tmp/ap_String_Id.h.h:678 -msgid "Change the number of columns" -msgstr "" - -#. MENU_STATUSLINE_FILE_PAGESETUP -#: po/tmp/ap_String_Id.h.h:680 -msgid "Change the printing options" -msgstr "" - -#. MENU_STATUSLINE_FMT_FRAME -#: po/tmp/ap_String_Id.h.h:682 -msgid "Change the properties of the Text Box" -msgstr "" - -#. MENU_STATUSLINE_SPELL_SUGGEST_1 -#. MENU_STATUSLINE_SPELL_SUGGEST_2 -#. MENU_STATUSLINE_SPELL_SUGGEST_3 -#. MENU_STATUSLINE_SPELL_SUGGEST_4 -#. MENU_STATUSLINE_SPELL_SUGGEST_5 -#. MENU_STATUSLINE_SPELL_SUGGEST_6 -#. MENU_STATUSLINE_SPELL_SUGGEST_7 -#. MENU_STATUSLINE_SPELL_SUGGEST_8 -#. MENU_STATUSLINE_SPELL_SUGGEST_9 -#: po/tmp/ap_String_Id.h.h:692 -msgid "Change to this suggested spelling" -msgstr "" - -#. MENU_STATUSLINE_FMT_BACKGROUND -#: po/tmp/ap_String_Id.h.h:694 -msgid "Change your document's page background" -msgstr "" - -#. MENU_STATUSLINE_FMT_BACKGROUND_PAGE_COLOR -#: po/tmp/ap_String_Id.h.h:696 -msgid "Change your document's page color" -msgstr "" - -#. DLG_Styles_ModifyCharacter -#: po/tmp/ap_String_Id.h.h:698 -msgid "Character" -msgstr "" - -#. FIELD_Numbers_CharCount -#: po/tmp/ap_String_Id.h.h:700 -msgid "Character Count" -msgstr "" - -#. FIELD_Numbers_NbspCount -#: po/tmp/ap_String_Id.h.h:702 -msgid "Character Count (w/o spaces)" -msgstr "" - -#. DLG_Styles_CharPrev -#: po/tmp/ap_String_Id.h.h:704 -msgid "Character Preview" -msgstr "" - -#. DLG_WordCount_Characters_No -#: po/tmp/ap_String_Id.h.h:706 -msgid "Characters (no spaces):" -msgstr "" - -#. DLG_WordCount_Characters_Sp -#: po/tmp/ap_String_Id.h.h:708 -msgid "Characters (with spaces):" -msgstr "" - -#. MENU_LABEL_TOOLS_SPELL -#: po/tmp/ap_String_Id.h.h:710 -msgid "Check &Spelling" -msgstr "" - -#. DLG_Options_Label_GrammarCheck -#: po/tmp/ap_String_Id.h.h:712 -msgid "Check &grammar as you type" -msgstr "" - -#. MENU_LABEL_HELP_CHECKVER -#: po/tmp/ap_String_Id.h.h:714 -msgid "Check for &Updates" -msgstr "" - -#. MENU_STATUSLINE_HELP_CHECKVER -#: po/tmp/ap_String_Id.h.h:716 -msgid "Check online for newer versions of AbiWord" -msgstr "" - -#. DLG_Options_Label_SpellCheckAsType -#: po/tmp/ap_String_Id.h.h:718 -msgid "Check s&pelling as you type" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_SPELL -#: po/tmp/ap_String_Id.h.h:720 -msgid "Check the document for incorrect spelling" -msgstr "" - -#. DLG_NEW_Choose -#: po/tmp/ap_String_Id.h.h:722 -msgid "Choose" -msgstr "" - -#. DLG_Options_Label_ChooseForTransparent -#: po/tmp/ap_String_Id.h.h:724 -msgid "Choose Screen Color" -msgstr "" - -#. DLG_Options_Label_ColorChooserLabel -#: po/tmp/ap_String_Id.h.h:726 -msgid "Choose screen color for AbiWord" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_SET_VIEW_LEVEL -#: po/tmp/ap_String_Id.h.h:728 -msgid "Choose which revision you wish to view" -msgstr "" - -#. DLG_Goto_Label_Help -#: po/tmp/ap_String_Id.h.h:730 -msgid "" -"Choose your target in the left side.\n" -"If you want to use the \"Go To\" button, just fill the Number Entry with the " -"desired number. You can use + and - to perform relative movement.\tI.e., if " -"you write \"+2\" and you select \"Line\", the \"Go To\" will go 2 lines " -"below your current position." -msgstr "" - -#. MENU_LABEL_EDIT_CLEAR -#: po/tmp/ap_String_Id.h.h:732 -msgid "Cle&ar" -msgstr "" - -#. DLG_Tab_Button_Clear -#: po/tmp/ap_String_Id.h.h:734 -msgid "Clear" -msgstr "" - -#. DLG_Tab_Button_ClearAll -#: po/tmp/ap_String_Id.h.h:736 -msgid "Clear &All" -msgstr "" - -#. DLG_Background_ClearClr -#: po/tmp/ap_String_Id.h.h:738 -msgid "Clear Background Color" -msgstr "" - -#. DLG_Background_ClearHighlight -#: po/tmp/ap_String_Id.h.h:740 -msgid "Clear Highlight Color" -msgstr "" - -#. MSG_QueryExit -#: po/tmp/ap_String_Id.h.h:742 -msgid "Close all windows and exit?" -msgstr "" - -#. MENU_STATUSLINE_FILE_EXIT -#: po/tmp/ap_String_Id.h.h:744 -msgid "Close all windows in the application and exit" -msgstr "" - -#. MENU_STATUSLINE_FILE_CLOSE -#: po/tmp/ap_String_Id.h.h:746 -msgid "Close the document" -msgstr "" - -#. MENU_LABEL_TABLE_SELECT_COLUMN -#: po/tmp/ap_String_Id.h.h:748 -msgid "Co&lumn" -msgstr "" - -#. DLG_FormatFrame_Color -#. DLG_FormatTable_Color -#. DLG_UFS_ColorLabel -#: po/tmp/ap_String_Id.h.h:751 po/tmp/xap_String_Id.h.h:191 -msgid "Color:" -msgstr "" - -#. DLG_FormatTable_Apply_To_Column -#: po/tmp/ap_String_Id.h.h:753 -msgid "Column" -msgstr "" - -#. ColumnGapStatus -#: po/tmp/ap_String_Id.h.h:755 -#, c-format -msgid "Column Gap [%s]" -msgstr "" - -#. ColumnStatus -#: po/tmp/ap_String_Id.h.h:757 -#, c-format -msgid "Column [%d]" -msgstr "" - -#. DLG_Column_ColumnTitle -#: po/tmp/ap_String_Id.h.h:759 -msgid "Columns" -msgstr "" - -#. MENU_LABEL_TABLE_INSERT_COLUMNS_BEFORE -#: po/tmp/ap_String_Id.h.h:761 -msgid "Columns &Left" -msgstr "" - -#. MENU_LABEL_TABLE_INSERT_COLUMNS_AFTER -#: po/tmp/ap_String_Id.h.h:763 -msgid "Columns &Right" -msgstr "" - -#. DLG_ListRevisions_Column3Label -#: po/tmp/ap_String_Id.h.h:765 -msgid "Comment" -msgstr "" - -#. DLG_MarkRevisions_Comment2Label -#: po/tmp/ap_String_Id.h.h:767 -msgid "Comment to be associated with the revision:" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_COMPARE_DOCUMENTS -#: po/tmp/ap_String_Id.h.h:769 -msgid "Compare active document to another document" -msgstr "" - -#. FIELD_Application_CompileDate -#: po/tmp/ap_String_Id.h.h:771 -msgid "Compile Date" -msgstr "" - -#. FIELD_Application_CompileTime -#: po/tmp/ap_String_Id.h.h:773 -msgid "Compile Time" -msgstr "" - -#. DLG_Break_Continuous -#: po/tmp/ap_String_Id.h.h:775 -msgid "Con&tinuous" -msgstr "" - -#. TOC_TocHeading -#: po/tmp/ap_String_Id.h.h:777 -msgid "Contents" -msgstr "" - -#. DLG_MarkRevisions_Check1Label -#: po/tmp/ap_String_Id.h.h:779 -#, c-format -msgid "Continue previous revision (number %d)" -msgstr "" - -#. FIELD_Document_Contributor -#: po/tmp/ap_String_Id.h.h:781 -msgid "Contributor" -msgstr "" - -#. DLG_MetaData_CoAuthor_LBL -#: po/tmp/ap_String_Id.h.h:783 -msgid "Contributor(s):" -msgstr "" - -#. MENU_STATUSLINE_TABLE_TEXTTOTABLE -#: po/tmp/ap_String_Id.h.h:785 -msgid "Convert Selected Text to a Table" -msgstr "" - -#. MENU_LABEL_TABLE_TABLETOTEXT -#: po/tmp/ap_String_Id.h.h:787 -msgid "Convert Table to Text" -msgstr "" - -#. MENU_LABEL_TABLE_TEXTTOTABLE -#: po/tmp/ap_String_Id.h.h:789 -msgid "Convert Text to Table" -msgstr "" - -#. MENU_STATUSLINE_TABLE_TABLETOTEXT -#: po/tmp/ap_String_Id.h.h:791 -msgid "Convert from a Table to Text" -msgstr "" - -#. TOOLBAR_LABEL_EDIT_COPY -#. TOOLBAR_STATUSLINE_EDIT_COPY -#. TOOLBAR_TOOLTIP_EDIT_COPY -#: po/tmp/ap_String_Id.h.h:795 -msgid "Copy" -msgstr "" - -#. MENU_STATUSLINE_EDIT_COPYEMBED -#: po/tmp/ap_String_Id.h.h:797 -msgid "Copy Embedded Object" -msgstr "" - -#. MENU_LABEL_EDIT_COPYIMAGE -#: po/tmp/ap_String_Id.h.h:799 -msgid "Copy Image" -msgstr "" - -#. MENU_LABEL_EDIT_COPYEMBED -#: po/tmp/ap_String_Id.h.h:801 -msgid "Copy Object" -msgstr "" - -#. MENU_LABEL_EDIT_COPY_FRAME -#: po/tmp/ap_String_Id.h.h:803 -msgid "Copy Text Box" -msgstr "" - -#. MENU_STATUSLINE_EDIT_COPY_HYPERLINK_LOCATION -#: po/tmp/ap_String_Id.h.h:805 -msgid "Copy hyperlink location" -msgstr "" - -#. MENU_STATUSLINE_EDIT_COPY_FRAME -#: po/tmp/ap_String_Id.h.h:807 -msgid "Copy the Text Box to the clipboard" -msgstr "" - -#. MENU_STATUSLINE_EDIT_CUT_FRAME -#: po/tmp/ap_String_Id.h.h:809 -msgid "Copy the Text Box to the clipboard then remove it" -msgstr "" - -#. MENU_STATUSLINE_EDIT_COPY -#: po/tmp/ap_String_Id.h.h:811 -msgid "Copy the selection and put it on the Clipboard" -msgstr "" - -#. MSG_IE_CouldNotOpen -#: po/tmp/ap_String_Id.h.h:813 -#, c-format -msgid "Could not open file %s for writing" -msgstr "" - -#. MSG_OpenFailed -#: po/tmp/ap_String_Id.h.h:815 -#, c-format -msgid "Could not open file %s." -msgstr "" - -#. MSG_IE_CouldNotWrite -#: po/tmp/ap_String_Id.h.h:817 -#, c-format -msgid "Could not write to file %s" -msgstr "" - -#. MSG_SaveFailed -#: po/tmp/ap_String_Id.h.h:819 -#, c-format -msgid "Could not write to the file %s." -msgstr "" - -#. MENU_STATUSLINE_TOOLS_WORDCOUNT -#: po/tmp/ap_String_Id.h.h:821 -msgid "Count the number of words in the document" -msgstr "" - -#. FIELD_Document_Coverage -#: po/tmp/ap_String_Id.h.h:823 -msgid "Coverage" -msgstr "" - -#. DLG_MetaData_Coverage_LBL -#: po/tmp/ap_String_Id.h.h:825 -msgid "Coverage:" -msgstr "" - -#. DLG_NEW_Tab1_FAX1 -#: po/tmp/ap_String_Id.h.h:827 -msgid "Create a fax" -msgstr "" - -#. DLG_NEW_Tab1_WP1 -#: po/tmp/ap_String_Id.h.h:829 -msgid "Create a new blank document" -msgstr "" - -#. MENU_STATUSLINE_FILE_NEW -#. TOOLBAR_STATUSLINE_FILE_NEW -#. TOOLBAR_TOOLTIP_FILE_NEW -#: po/tmp/ap_String_Id.h.h:833 -msgid "Create a new document" -msgstr "" - -#. DLG_NEW_Create -#: po/tmp/ap_String_Id.h.h:835 -msgid "Create a new document from a template" -msgstr "" - -#. MENU_STATUSLINE_FILE_NEW_USING_TEMPLATE -#: po/tmp/ap_String_Id.h.h:837 -msgid "Create a new document using a template" -msgstr "" - -#. DLG_NEW_StartEmpty -#: po/tmp/ap_String_Id.h.h:839 -msgid "Create an empty document" -msgstr "" - -#. FIELD_Document_Creator -#: po/tmp/ap_String_Id.h.h:841 -msgid "Creator" -msgstr "" - -#. MENU_LABEL_EDIT_CUT -#: po/tmp/ap_String_Id.h.h:843 -msgid "Cu&t" -msgstr "" - -#. FIELD_Datetime_CurrentDate -#: po/tmp/ap_String_Id.h.h:845 -msgid "Current Date" -msgstr "" - -#. DLG_Lists_Current_Font -#: po/tmp/ap_String_Id.h.h:847 -msgid "Current Font" -msgstr "" - -#. DLG_Lists_Current_List_Label -#: po/tmp/ap_String_Id.h.h:849 -msgid "Current List Label" -msgstr "" - -#. DLG_Lists_Current_List_Type -#: po/tmp/ap_String_Id.h.h:851 -msgid "Current List Type" -msgstr "" - -#. MSG_EmptySelection -#: po/tmp/ap_String_Id.h.h:853 -msgid "Current Selection is Empty" -msgstr "" - -#. DLG_Styles_DefCurrent -#: po/tmp/ap_String_Id.h.h:855 -msgid "Current Settings" -msgstr "" - -#. FIELD_Datetime_CurrentTime -#: po/tmp/ap_String_Id.h.h:857 -msgid "Current Time" -msgstr "" - -#. DLG_Options_Label_ViewCursorBlink -#: po/tmp/ap_String_Id.h.h:859 -msgid "Cursor &blink" -msgstr "" - -#. DLG_Options_Label_SpellCustomDict -#: po/tmp/ap_String_Id.h.h:861 -msgid "Custom Dictionary:" -msgstr "" - -#. FIELD_DateTime_Custom -#: po/tmp/ap_String_Id.h.h:863 -msgid "Customizable date/time" -msgstr "" - -#. DLG_Lists_Customize -#: po/tmp/ap_String_Id.h.h:865 -msgid "Customized List" -msgstr "" - -#. TOOLBAR_LABEL_EDIT_CUT -#. TOOLBAR_STATUSLINE_EDIT_CUT -#. TOOLBAR_TOOLTIP_EDIT_CUT -#: po/tmp/ap_String_Id.h.h:869 -msgid "Cut" -msgstr "" - -#. MENU_STATUSLINE_EDIT_CUTEMBED -#: po/tmp/ap_String_Id.h.h:871 -msgid "Cut Embedded Object" -msgstr "" - -#. MENU_LABEL_EDIT_CUTIMAGE -#: po/tmp/ap_String_Id.h.h:873 -msgid "Cut Image" -msgstr "" - -#. MENU_LABEL_EDIT_CUTEMBED -#: po/tmp/ap_String_Id.h.h:875 -msgid "Cut Object" -msgstr "" - -#. MENU_LABEL_EDIT_CUT_FRAME -#: po/tmp/ap_String_Id.h.h:877 -msgid "Cut Text Box" -msgstr "" - -#. MENU_STATUSLINE_EDIT_CUT -#: po/tmp/ap_String_Id.h.h:879 -msgid "Cut the selection and put it on the Clipboard" -msgstr "" - -#. MENU_LABEL_FMT_DIRECTION -#: po/tmp/ap_String_Id.h.h:881 -msgid "D&irectional" -msgstr "" - -#. DLG_Lists_Dashed_List -#. STYLE_DASHEDLIST -#: po/tmp/ap_String_Id.h.h:883 po/tmp/xap_String_Id.h.h:241 -msgid "Dashed List" -msgstr "" - -#. FIELD_Document_Date -#. DLG_ListRevisions_Column2Label -#: po/tmp/ap_String_Id.h.h:886 -msgid "Date" -msgstr "" - -#. MENU_LABEL_INSERT_DATETIME -#: po/tmp/ap_String_Id.h.h:888 -msgid "Date and &Time" -msgstr "" - -#. FIELD_Type_Datetime -#: po/tmp/ap_String_Id.h.h:890 -msgid "Date and Time" -msgstr "" - -#. FIELD_DateTime_DOY -#: po/tmp/ap_String_Id.h.h:892 -msgid "Day # in the year" -msgstr "" - -#. DLG_Options_Btn_Default -#: po/tmp/ap_String_Id.h.h:894 -msgid "De&faults" -msgstr "" - -#. DLG_Tab_Radio_Decimal -#: po/tmp/ap_String_Id.h.h:896 -msgid "Decimal" -msgstr "" - -#. TabToggleDecimalTab -#: po/tmp/ap_String_Id.h.h:898 -msgid "Decimal Tab" -msgstr "" - -#. TOOLBAR_LABEL_UNINDENT -#. TOOLBAR_STATUSLINE_UNINDENT -#. TOOLBAR_TOOLTIP_UNINDENT -#: po/tmp/ap_String_Id.h.h:902 -msgid "Decrease indent" -msgstr "" - -#. FIELD_DateTime_DefaultDateNoTime -#: po/tmp/ap_String_Id.h.h:904 -msgid "Default date (w/o time)" -msgstr "" - -#. FIELD_DateTime_DefaultDate -#: po/tmp/ap_String_Id.h.h:906 -msgid "Default date representation" -msgstr "" - -#. DLG_Options_Label_DefaultPageSize -#: po/tmp/ap_String_Id.h.h:908 -msgid "Default page size" -msgstr "" - -#. DLG_Tab_Label_DefaultTS -#: po/tmp/ap_String_Id.h.h:910 -msgid "Default tab stops:" -msgstr "" - -#. DLG_Options_Label_DirectionRtl -#: po/tmp/ap_String_Id.h.h:912 -msgid "Default to right-to-left direction of text" -msgstr "" - -#. DLG_FormatTOC_LevelDefs -#: po/tmp/ap_String_Id.h.h:914 -msgid "Define Main Properties" -msgstr "" - -#. MENU_STATUSLINE_FMT_STYLE -#. MENU_STATUSLINE_FMT_STYLE_DEFINE -#: po/tmp/ap_String_Id.h.h:917 -msgid "Define or apply style for the selection" -msgstr "" - -#. DLG_Styles_Delete -#. MENU_STATUSLINE_TABLE_DELETE -#. DLG_Delete -#: po/tmp/ap_String_Id.h.h:920 po/tmp/xap_String_Id.h.h:255 -msgid "Delete" -msgstr "" - -#. MENU_STATUSLINE_TABLE_DELETE_CELLS -#: po/tmp/ap_String_Id.h.h:922 -msgid "Delete Cells" -msgstr "" - -#. MENU_LABEL_TABLE_DELETECOLUMN -#: po/tmp/ap_String_Id.h.h:924 -msgid "Delete Co&lumn" -msgstr "" - -#. MENU_STATUSLINE_TABLE_DELETE_COLUMNS -#. MENU_STATUSLINE_TABLE_DELETECOLUMN -#: po/tmp/ap_String_Id.h.h:927 -msgid "Delete Column" -msgstr "" - -#. MENU_STATUSLINE_EDIT_DELETEEMBED -#: po/tmp/ap_String_Id.h.h:929 -msgid "Delete Embedded Object" -msgstr "" - -#. MENU_LABEL_EDIT_DELETEIMAGE -#: po/tmp/ap_String_Id.h.h:931 -msgid "Delete Image" -msgstr "" - -#. MENU_LABEL_EDIT_DELETEEMBED -#: po/tmp/ap_String_Id.h.h:933 -msgid "Delete Object" -msgstr "" - -#. MENU_LABEL_TABLE_DELETEROW -#: po/tmp/ap_String_Id.h.h:935 -msgid "Delete Ro&w" -msgstr "" - -#. MENU_STATUSLINE_TABLE_DELETE_ROWS -#. MENU_STATUSLINE_TABLE_DELETEROW -#: po/tmp/ap_String_Id.h.h:938 -msgid "Delete Row" -msgstr "" - -#. MENU_LABEL_TABLE_DELETETABLE -#: po/tmp/ap_String_Id.h.h:940 -msgid "Delete Tabl&e" -msgstr "" - -#. MENU_STATUSLINE_TABLE_DELETE_TABLE -#. MENU_STATUSLINE_TABLE_DELETETABLE -#: po/tmp/ap_String_Id.h.h:943 -msgid "Delete Table" -msgstr "" - -#. MENU_LABEL_EDIT_DELETEFRAME -#: po/tmp/ap_String_Id.h.h:945 -msgid "Delete Text Box" -msgstr "" - -#. TOOLBAR_LABEL_DELETE_COLUMN -#: po/tmp/ap_String_Id.h.h:947 -msgid "Delete column" -msgstr "" - -#. MENU_STATUSLINE_INSERT_DELETE_HYPERLINK -#: po/tmp/ap_String_Id.h.h:949 -msgid "Delete hyperlink" -msgstr "" - -#. TOOLBAR_LABEL_DELETE_ROW -#: po/tmp/ap_String_Id.h.h:951 -msgid "Delete row" -msgstr "" - -#. MENU_STATUSLINE_EDIT_CLEAR -#: po/tmp/ap_String_Id.h.h:953 -msgid "Delete the selection" -msgstr "" - -#. TOOLBAR_STATUSLINE_DELETE_COLUMN -#. TOOLBAR_TOOLTIP_DELETE_COLUMN -#: po/tmp/ap_String_Id.h.h:956 -msgid "Delete this column from its table" -msgstr "" - -#. TOOLBAR_STATUSLINE_DELETE_ROW -#. TOOLBAR_TOOLTIP_DELETE_ROW -#: po/tmp/ap_String_Id.h.h:959 -msgid "Delete this row from its table" -msgstr "" - -#. DLG_Styles_Description -#. DLG_Styles_ModifyDescription -#. FIELD_Document_Description -#: po/tmp/ap_String_Id.h.h:963 -msgid "Description" -msgstr "" - -#. DLG_MetaData_Description_LBL -#. DLG_PLUGIN_MANAGER_DESC -#. DLG_Image_LblDescription -#: po/tmp/ap_String_Id.h.h:965 po/tmp/xap_String_Id.h.h:258 -msgid "Description:" -msgstr "" - -#. DLG_Lists_Diamond_List -#. STYLE_DIAMONLIST -#: po/tmp/ap_String_Id.h.h:967 po/tmp/xap_String_Id.h.h:260 -msgid "Diamond List" -msgstr "" - -#. DLG_Options_Label_SpellDictionaries -#: po/tmp/ap_String_Id.h.h:969 -msgid "Dictionaries" -msgstr "" - -#. DLG_HdrFtr_FooterEven -#: po/tmp/ap_String_Id.h.h:971 -msgid "Different footer on facing pages" -msgstr "" - -#. DLG_HdrFtr_FooterFirst -#: po/tmp/ap_String_Id.h.h:973 -msgid "Different footer on first page" -msgstr "" - -#. DLG_HdrFtr_FooterLast -#: po/tmp/ap_String_Id.h.h:975 -msgid "Different footer on last page" -msgstr "" - -#. DLG_HdrFtr_HeaderEven -#: po/tmp/ap_String_Id.h.h:977 -msgid "Different header on facing pages" -msgstr "" - -#. DLG_HdrFtr_HeaderFirst -#: po/tmp/ap_String_Id.h.h:979 -msgid "Different header on first page" -msgstr "" - -#. DLG_HdrFtr_HeaderLast -#: po/tmp/ap_String_Id.h.h:981 -msgid "Different header on last page" -msgstr "" - -#. DLG_Styles_StylesLocked -#: po/tmp/ap_String_Id.h.h:983 -msgid "Disable all formatting commands, except styles" -msgstr "" - -#. MENU_STATUSLINE_HELP_CREDITS -#: po/tmp/ap_String_Id.h.h:985 -msgid "Display Credits" -msgstr "" - -#. MENU_STATUSLINE_HELP_CONTENTS -#: po/tmp/ap_String_Id.h.h:987 -msgid "Display Help Contents" -msgstr "" - -#. MENU_STATUSLINE_HELP_INDEX -#: po/tmp/ap_String_Id.h.h:989 -msgid "Display Help Index" -msgstr "" - -#. MENU_STATUSLINE_VIEW_SHOWPARA -#: po/tmp/ap_String_Id.h.h:991 -msgid "Display non-printing characters" -msgstr "" - -#. MENU_STATUSLINE_HELP_ABOUT -#: po/tmp/ap_String_Id.h.h:993 -msgid "Display program information, version number, and copyright" -msgstr "" - -#. DLG_FormatTOC_DispStyle -#: po/tmp/ap_String_Id.h.h:995 -msgid "Display style:" -msgstr "" - -#. DLG_Options_Prompt_IgnoreResetAll -#: po/tmp/ap_String_Id.h.h:997 -msgid "Do you want to reset ignored words in all the documents?" -msgstr "" - -#. DLG_Options_Prompt_IgnoreResetCurrent -#: po/tmp/ap_String_Id.h.h:999 -msgid "Do you want to reset ignored words in the current document?" -msgstr "" - -#. FIELD_Type_Document -#: po/tmp/ap_String_Id.h.h:1001 -msgid "Document" -msgstr "" - -#. DLG_MetaData_Title -#: po/tmp/ap_String_Id.h.h:1003 -msgid "Document Properties" -msgstr "" - -#. DLG_Options_Label_Documents -#: po/tmp/ap_String_Id.h.h:1005 -msgid "Documents" -msgstr "" - -#. DLG_FormatFootnotes_FootRestartNone -#: po/tmp/ap_String_Id.h.h:1007 -msgid "Don't restart" -msgstr "" - -#. DLG_Para_SpacingDouble -#: po/tmp/ap_String_Id.h.h:1009 -msgid "Double" -msgstr "" - -#. TOOLBAR_LABEL_DOUBLE_SPACE -#: po/tmp/ap_String_Id.h.h:1011 -msgid "Double Spacing" -msgstr "" - -#. TOOLBAR_STATUSLINE_DOUBLE_SPACE -#. TOOLBAR_TOOLTIP_DOUBLE_SPACE -#: po/tmp/ap_String_Id.h.h:1014 -msgid "Double spacing" -msgstr "" - -#. MENU_LABEL_EDIT_LATEXEQUATION -#: po/tmp/ap_String_Id.h.h:1016 -msgid "Edit Equation" -msgstr "" - -#. MENU_LABEL_EDIT_EDITFOOTER -#. TOOLBAR_LABEL_EDIT_FOOTER -#. TOOLBAR_STATUSLINE_EDIT_FOOTER -#. TOOLBAR_TOOLTIP_EDIT_FOOTER -#: po/tmp/ap_String_Id.h.h:1021 -msgid "Edit Footer" -msgstr "" - -#. MENU_LABEL_EDIT_EDITHEADER -#. TOOLBAR_LABEL_EDIT_HEADER -#. TOOLBAR_STATUSLINE_EDIT_HEADER -#. TOOLBAR_TOOLTIP_EDIT_HEADER -#: po/tmp/ap_String_Id.h.h:1026 -msgid "Edit Header" -msgstr "" - -#. MENU_STATUSLINE_EDIT_LATEXEQUATION -#: po/tmp/ap_String_Id.h.h:1028 -msgid "Edit Latex Equation" -msgstr "" - -#. MENU_STATUSLINE_INSERT_EDIT_HYPERLINK -#: po/tmp/ap_String_Id.h.h:1030 -msgid "Edit hyperlink" -msgstr "" - -#. MENU_STATUSLINE_VIEW_HEADFOOT -#: po/tmp/ap_String_Id.h.h:1032 -msgid "Edit text at the top or bottom of every page" -msgstr "" - -#. MENU_STATUSLINE_EDIT_EDITFOOTER -#: po/tmp/ap_String_Id.h.h:1034 -msgid "Edit the Footer on the current page" -msgstr "" - -#. MENU_STATUSLINE_EDIT_EDITHEADER -#: po/tmp/ap_String_Id.h.h:1036 -msgid "Edit the Header on the current page" -msgstr "" - -#. TB_Embedded -#: po/tmp/ap_String_Id.h.h:1038 -msgid "Embedded" -msgstr "" - -#. MENU_LABEL_VIEW_LOCKSTYLES -#: po/tmp/ap_String_Id.h.h:1040 -msgid "Enable F&ormatting Tools" -msgstr "" - -#. DLG_Options_Label_CheckEnableSmoothScrolling -#: po/tmp/ap_String_Id.h.h:1042 -msgid "Enable Smooth Scrolling" -msgstr "" - -#. FIELD_Numbers_EndnoteAnchor -#: po/tmp/ap_String_Id.h.h:1044 -msgid "Endnote anchor" -msgstr "" - -#. FIELD_Numbers_EndnoteReference -#: po/tmp/ap_String_Id.h.h:1046 -msgid "Endnote reference" -msgstr "" - -#. DLG_FormatFootnotes_EndStyle -#: po/tmp/ap_String_Id.h.h:1048 -msgid "Endnote style" -msgstr "" - -#. MENU_LABEL_INSERT_EQUATION -#: po/tmp/ap_String_Id.h.h:1050 -msgid "Equation" -msgstr "" - -#. FIELD_Error -#: po/tmp/ap_String_Id.h.h:1052 -msgid "Error calculating value!" -msgstr "" - -#. SCRIPT_CANTRUN -#: po/tmp/ap_String_Id.h.h:1054 -#, c-format -msgid "Error executing script %s" -msgstr "" - -#. MSG_ImportError -#: po/tmp/ap_String_Id.h.h:1056 -#, c-format -msgid "Error importing file %s." -msgstr "" - -#. MSG_SaveFailedExport -#: po/tmp/ap_String_Id.h.h:1058 -#, c-format -msgid "Error while attempting to save %s: could not construct exporter" -msgstr "" - -#. MSG_SaveFailedName -#: po/tmp/ap_String_Id.h.h:1060 -#, c-format -msgid "Error while attempting to save %s: invalid name" -msgstr "" - -#. TOOLBAR_LABEL_SCRIPT_PLAY -#: po/tmp/ap_String_Id.h.h:1062 -msgid "Ex. script" -msgstr "" - -#. DLG_Para_SpacingExactly -#: po/tmp/ap_String_Id.h.h:1064 -msgid "Exactly" -msgstr "" - -#. DLG_Latex_Example -#: po/tmp/ap_String_Id.h.h:1066 -msgid "Example:" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_SCRIPTS -#: po/tmp/ap_String_Id.h.h:1068 -msgid "Execute helper scripts" -msgstr "" - -#. TOOLBAR_STATUSLINE_SCRIPT_PLAY -#. TOOLBAR_TOOLTIP_SCRIPT_PLAY -#: po/tmp/ap_String_Id.h.h:1071 -msgid "Execute script" -msgstr "" - -#. DLG_ListRevisions_Label1 -#: po/tmp/ap_String_Id.h.h:1073 -msgid "Existing revisions:" -msgstr "" - -#. TB_Extra -#: po/tmp/ap_String_Id.h.h:1075 -msgid "Extra" -msgstr "" - -#. DLG_Field_Parameters_Capital -#: po/tmp/ap_String_Id.h.h:1077 -msgid "Extra Parameters" -msgstr "" - -#. DLG_Options_Label_ViewExtraTB -#: po/tmp/ap_String_Id.h.h:1079 -msgid "Extra Toolbar" -msgstr "" - -#. DLG_Field_Parameters -#: po/tmp/ap_String_Id.h.h:1081 -msgid "Extra parameters:" -msgstr "" - -#. MENU_LABEL_INSERT_FILE -#: po/tmp/ap_String_Id.h.h:1083 -msgid "F&ile" -msgstr "" - -#. MENU_LABEL_FORMAT -#: po/tmp/ap_String_Id.h.h:1085 -msgid "F&ormat" -msgstr "" - -#. MENU_LABEL_VIEW_FULLSCREEN -#: po/tmp/ap_String_Id.h.h:1087 -msgid "F&ull Screen" -msgstr "" - -#. DLG_FR_FindLabel -#: po/tmp/ap_String_Id.h.h:1089 -msgid "Fi&nd what:" -msgstr "" - -#. DLG_MailMerge_Insert_No_Colon -#: po/tmp/ap_String_Id.h.h:1091 -msgid "Field Name" -msgstr "" - -#. DLG_MailMerge_Insert -#: po/tmp/ap_String_Id.h.h:1093 -msgid "Field Name:" -msgstr "" - -#. MSG_IE_UnsupportedType -#: po/tmp/ap_String_Id.h.h:1095 -#, c-format -msgid "File %s is not of a currently supported file type" -msgstr "" - -#. MSG_IE_FakeType -#: po/tmp/ap_String_Id.h.h:1097 -#, c-format -msgid "File %s is not of the type it claims to be" -msgstr "" - -#. MSG_IE_UnknownType -#: po/tmp/ap_String_Id.h.h:1099 -#, c-format -msgid "File %s is of unknown type" -msgstr "" - -#. MSG_IE_FileNotFound -#: po/tmp/ap_String_Id.h.h:1101 -#, c-format -msgid "File %s not found" -msgstr "" - -#. FIELD_Application_Filename -#: po/tmp/ap_String_Id.h.h:1103 -msgid "File Name" -msgstr "" - -#. DLG_FormatTOC_FillStyle -#: po/tmp/ap_String_Id.h.h:1105 -msgid "Fill style:" -msgstr "" - -#. DLG_FR_FindTitle -#: po/tmp/ap_String_Id.h.h:1107 -msgid "Find" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_FIND_NEXT -#: po/tmp/ap_String_Id.h.h:1109 -msgid "Find &next revision" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_FIND_PREV -#: po/tmp/ap_String_Id.h.h:1111 -msgid "Find &previous revision" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_FIND_NEXT -#: po/tmp/ap_String_Id.h.h:1113 -msgid "Find next visible revision in the document" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_FIND_PREV -#: po/tmp/ap_String_Id.h.h:1115 -msgid "Find previous visible revision in the document" -msgstr "" - -#. MENU_STATUSLINE_EDIT_FIND -#: po/tmp/ap_String_Id.h.h:1117 -msgid "Find the specified text" -msgstr "" - -#. FirstLineIndentStatus -#: po/tmp/ap_String_Id.h.h:1119 -#, c-format -msgid "First Line Indent [%s]" -msgstr "" - -#. DLG_Para_SpecialFirstLine -#: po/tmp/ap_String_Id.h.h:1121 -msgid "First line" -msgstr "" - -#. DLG_InsertTable_FixedColSize -#: po/tmp/ap_String_Id.h.h:1123 -msgid "Fixed column size:" -msgstr "" - -#. DLG_Lists_FoldingLevel1 -#: po/tmp/ap_String_Id.h.h:1125 -msgid "Fold below level 1" -msgstr "" - -#. DLG_Lists_FoldingLevel2 -#: po/tmp/ap_String_Id.h.h:1127 -msgid "Fold below level 2" -msgstr "" - -#. DLG_Lists_FoldingLevel3 -#: po/tmp/ap_String_Id.h.h:1129 -msgid "Fold below level 3" -msgstr "" - -#. DLG_Lists_FoldingLevel4 -#: po/tmp/ap_String_Id.h.h:1131 -msgid "Fold below level 4" -msgstr "" - -#. DLG_Para_PreviewFollowParagraph -#: po/tmp/ap_String_Id.h.h:1133 -msgid "" -"Following Paragraph Following Paragraph Following Paragraph Following " -"Paragraph Following Paragraph Following Paragraph Following Paragraph" -msgstr "" - -#. DLG_Styles_ModifyFont -#. TOOLBAR_LABEL_FMT_FONT -#. TOOLBAR_STATUSLINE_FMT_FONT -#. TOOLBAR_TOOLTIP_FMT_FONT -#. DLG_UFS_FontTitle -#. DLG_UFS_FontTab -#: po/tmp/ap_String_Id.h.h:1138 po/tmp/xap_String_Id.h.h:335 -msgid "Font" -msgstr "" - -#. TOOLBAR_STATUSLINE_FMT_CHOOSE -#: po/tmp/ap_String_Id.h.h:1140 -msgid "Font Choose" -msgstr "" - -#. TOOLBAR_LABEL_FMT_SIZE -#. TOOLBAR_STATUSLINE_FMT_SIZE -#. TOOLBAR_TOOLTIP_FMT_SIZE -#: po/tmp/ap_String_Id.h.h:1144 -msgid "Font Size" -msgstr "" - -#. TOOLBAR_LABEL_FMT_CHOOSE -#: po/tmp/ap_String_Id.h.h:1146 -msgid "Font choose" -msgstr "" - -#. TOOLBAR_LABEL_COLOR_FORE -#. TOOLBAR_STATUSLINE_COLOR_FORE -#. TOOLBAR_TOOLTIP_COLOR_FORE -#: po/tmp/ap_String_Id.h.h:1150 -msgid "Font color" -msgstr "" - -#. DLG_Lists_ButtonFont -#: po/tmp/ap_String_Id.h.h:1152 -msgid "Font..." -msgstr "" - -#. DLG_Lists_Font -#. DLG_UFS_FontLabel -#: po/tmp/ap_String_Id.h.h:1154 po/tmp/xap_String_Id.h.h:337 -msgid "Font:" -msgstr "" - -#. MENU_LABEL_INSERT_FOOTNOTE -#: po/tmp/ap_String_Id.h.h:1156 -msgid "Foot¬e" -msgstr "" - -#. DLG_PageNumbers_Footer -#. MENU_LABEL_INSERT_FOOTER -#: po/tmp/ap_String_Id.h.h:1159 -msgid "Footer" -msgstr "" - -#. DLG_HdrFtr_FooterFrame -#: po/tmp/ap_String_Id.h.h:1161 -msgid "Footer Properties" -msgstr "" - -#. FooterStatus -#: po/tmp/ap_String_Id.h.h:1163 -#, c-format -msgid "Footer [%s]" -msgstr "" - -#. FIELD_Numbers_FootnoteAnchor -#: po/tmp/ap_String_Id.h.h:1165 -msgid "Footnote anchor" -msgstr "" - -#. FIELD_Numbers_FootnoteReference -#: po/tmp/ap_String_Id.h.h:1167 -msgid "Footnote reference" -msgstr "" - -#. DLG_FormatFootnotes_FootStyle -#: po/tmp/ap_String_Id.h.h:1169 -msgid "Footnote style" -msgstr "" - -#. MENU_LABEL_FMT_FOOTNOTES -#: po/tmp/ap_String_Id.h.h:1171 -msgid "Footnotes and Endnotes" -msgstr "" - -#. TOOLBAR_STATUSLINE_FMT_DIR_OVERRIDE_LTR -#. TOOLBAR_TOOLTIP_FMT_DIR_OVERRIDE_LTR -#: po/tmp/ap_String_Id.h.h:1174 -msgid "Force LTR direction of text" -msgstr "" - -#. TOOLBAR_STATUSLINE_FMT_DIR_OVERRIDE_RTL -#. TOOLBAR_TOOLTIP_FMT_DIR_OVERRIDE_RTL -#: po/tmp/ap_String_Id.h.h:1177 -msgid "Force RTL direction of text" -msgstr "" - -#. MENU_STATUSLINE_FMT_DIRECTION_DO_LTR -#: po/tmp/ap_String_Id.h.h:1179 -msgid "Force left-to-right direction of text" -msgstr "" - -#. MENU_STATUSLINE_FMT_DIRECTION_DO_RTL -#: po/tmp/ap_String_Id.h.h:1181 -msgid "Force right-to-left direction of text" -msgstr "" - -#. TOOLBAR_LABEL_FMT_DIR_OVERRIDE_LTR -#: po/tmp/ap_String_Id.h.h:1183 -msgid "Force text LTR" -msgstr "" - -#. TOOLBAR_LABEL_FMT_DIR_OVERRIDE_RTL -#: po/tmp/ap_String_Id.h.h:1185 -msgid "Force text RTL" -msgstr "" - -#. DLG_Styles_ModifyFormat -#. TB_Format -#: po/tmp/ap_String_Id.h.h:1188 -msgid "Format" -msgstr "" - -#. MENU_STATUSLINE_FMT_EMBED -#: po/tmp/ap_String_Id.h.h:1190 -msgid "Format Embedded Object" -msgstr "" - -#. DLG_FormatFootnotes_Endnotes -#: po/tmp/ap_String_Id.h.h:1192 -msgid "Format Endnotes" -msgstr "" - -#. DLG_FormatFootnotes_Footnotes -#: po/tmp/ap_String_Id.h.h:1194 -msgid "Format Footnotes" -msgstr "" - -#. DLG_FormatFootnotes_Title -#: po/tmp/ap_String_Id.h.h:1196 -msgid "Format Footnotes and Endnotes" -msgstr "" - -#. DLG_HdrFtr_Title -#: po/tmp/ap_String_Id.h.h:1198 -msgid "Format Header/Footers" -msgstr "" - -#. MENU_LABEL_FMT_EMBED -#: po/tmp/ap_String_Id.h.h:1200 -msgid "Format Object" -msgstr "" - -#. TOOLBAR_LABEL_FMTPAINTER -#: po/tmp/ap_String_Id.h.h:1202 -msgid "Format Painter" -msgstr "" - -#. DLG_FormatTableTitle -#. MENU_STATUSLINE_TABLE_FORMAT -#: po/tmp/ap_String_Id.h.h:1205 -msgid "Format Table" -msgstr "" - -#. DLG_FormatTOC_Title -#: po/tmp/ap_String_Id.h.h:1207 -msgid "Format Table of Contents" -msgstr "" - -#. DLG_FormatFrameTitle -#: po/tmp/ap_String_Id.h.h:1209 -msgid "Format Text Box" -msgstr "" - -#. DLG_Options_Label_ViewFormatTB -#: po/tmp/ap_String_Id.h.h:1211 -msgid "Format Toolbar" -msgstr "" - -#. MENU_STATUSLINE_FMT_POSIMAGE -#: po/tmp/ap_String_Id.h.h:1213 -msgid "Format this image" -msgstr "" - -#. MENU_STATUSLINE_FMT_STYLIST -#: po/tmp/ap_String_Id.h.h:1215 -msgid "Format your document using styles" -msgstr "" - -#. DLG_Lists_Format -#. DLG_DocComparison_Fmt -#: po/tmp/ap_String_Id.h.h:1217 po/tmp/xap_String_Id.h.h:343 -msgid "Format:" -msgstr "" - -#. MENU_LABEL_INSERT_EQUATION_FILE -#: po/tmp/ap_String_Id.h.h:1219 -msgid "From File" -msgstr "" - -#. MENU_LABEL_INSERT_EQUATION_LATEX -#: po/tmp/ap_String_Id.h.h:1221 -msgid "From LaTeX" -msgstr "" - -#. TOOLBAR_LABEL_VIEW_FULL_SCREEN -#. TOOLBAR_STATUSLINE_VIEW_FULL_SCREEN -#. TOOLBAR_TOOLTIP_VIEW_FULL_SCREEN -#: po/tmp/ap_String_Id.h.h:1225 -msgid "Full Screen" -msgstr "" - -#. DLG_FormatTOC_General -#. DLG_Options_Label_General -#. DLG_MetaData_TAB_General -#: po/tmp/ap_String_Id.h.h:1229 -msgid "General" -msgstr "" - -#. DLG_Goto_Btn_Goto -#: po/tmp/ap_String_Id.h.h:1231 -msgid "Go To" -msgstr "" - -#. DLG_Goto_Label_What -#: po/tmp/ap_String_Id.h.h:1233 -msgid "Go To &What:" -msgstr "" - -#. DLG_Goto_Title -#: po/tmp/ap_String_Id.h.h:1235 -msgid "Go to..." -msgstr "" - -#. DLG_FormatTOC_HasLabel -#: po/tmp/ap_String_Id.h.h:1237 -msgid "H&as label" -msgstr "" - -#. DLG_FormatTOC_HeadingText -#: po/tmp/ap_String_Id.h.h:1239 -msgid "H&eading text:" -msgstr "" - -#. DLG_Lists_Hand_List -#. STYLE_HANDLIST -#: po/tmp/ap_String_Id.h.h:1241 po/tmp/xap_String_Id.h.h:383 -msgid "Hand List" -msgstr "" - -#. DLG_Para_SpecialHanging -#: po/tmp/ap_String_Id.h.h:1243 -msgid "Hanging" -msgstr "" - -#. DLG_PageNumbers_Header -#. MENU_LABEL_INSERT_HEADER -#: po/tmp/ap_String_Id.h.h:1246 -msgid "Header" -msgstr "" - -#. DLG_HdrFtr_HeaderFrame -#: po/tmp/ap_String_Id.h.h:1248 -msgid "Header Properties" -msgstr "" - -#. HeaderStatus -#: po/tmp/ap_String_Id.h.h:1250 -#, c-format -msgid "Header [%s]" -msgstr "" - -#. MENU_LABEL_FMT_HDRFTR -#: po/tmp/ap_String_Id.h.h:1252 -msgid "Header/Footers" -msgstr "" - -#. MSG_CHECK_PRINT_MODE -#: po/tmp/ap_String_Id.h.h:1254 -msgid "" -"Headers and Footers can only be created and edited while in Print View " -"Mode. \n" -" To enter this mode choose View then Print Layout from the Menus. \n" -" Would you like to enter Print Layout mode right now?" -msgstr "" - -#. DLG_Stylist_HeadingStyles -#: po/tmp/ap_String_Id.h.h:1256 -msgid "Heading Styles" -msgstr "" - -#. DLG_FormatTOC_HeadingStyle -#: po/tmp/ap_String_Id.h.h:1258 -msgid "Heading style:" -msgstr "" - -#. DLG_Lists_Heart_List -#. STYLE_HEARTLIST -#: po/tmp/ap_String_Id.h.h:1260 po/tmp/xap_String_Id.h.h:399 -msgid "Heart List" -msgstr "" - -#. DLG_Lists_Hebrew_List -#: po/tmp/ap_String_Id.h.h:1262 -msgid "Hebrew List" -msgstr "" - -#. TOOLBAR_LABEL_HELP -#. TOOLBAR_STATUSLINE_HELP -#. TOOLBAR_TOOLTIP_HELP -#: po/tmp/ap_String_Id.h.h:1266 -msgid "Help" -msgstr "" - -#. MENU_LABEL_HELP_CONTENTS -#: po/tmp/ap_String_Id.h.h:1268 -msgid "Help &Contents" -msgstr "" - -#. MENU_LABEL_HELP_INDEX -#: po/tmp/ap_String_Id.h.h:1270 -msgid "Help &Introduction" -msgstr "" - -#. DLG_Options_Label_Hide -#: po/tmp/ap_String_Id.h.h:1272 -msgid "Hide" -msgstr "" - -#. DLG_Options_Label_SpellHideErrors -#: po/tmp/ap_String_Id.h.h:1274 -msgid "Hide &spelling errors in the document" -msgstr "" - -#. DLG_Lists_FoldingLevelexp -#: po/tmp/ap_String_Id.h.h:1276 -msgid "Hide text below List Levels" -msgstr "" - -#. TOOLBAR_LABEL_COLOR_BACK -#. TOOLBAR_STATUSLINE_COLOR_BACK -#. TOOLBAR_TOOLTIP_COLOR_BACK -#: po/tmp/ap_String_Id.h.h:1280 -msgid "Highlight" -msgstr "" - -#. DLG_Spell_IgnoreAll -#: po/tmp/ap_String_Id.h.h:1282 -msgid "I&gnore All" -msgstr "" - -#. DLG_FormatTOC_Indent -#: po/tmp/ap_String_Id.h.h:1284 -msgid "I&ndent:" -msgstr "" - -#. InsertModeFieldINS -#: po/tmp/ap_String_Id.h.h:1286 -msgid "INS" -msgstr "" - -#. DLG_Options_Label_Icons -#: po/tmp/ap_String_Id.h.h:1288 -msgid "Icons" -msgstr "" - -#. DLG_Options_Label_Ignore -#: po/tmp/ap_String_Id.h.h:1290 -msgid "Ignore" -msgstr "" - -#. DLG_Options_Label_SpellIgnoreWords -#: po/tmp/ap_String_Id.h.h:1292 -msgid "Ignore Words" -msgstr "" - -#. MENU_STATUSLINE_SPELL_IGNOREALL -#: po/tmp/ap_String_Id.h.h:1294 -msgid "Ignore all occurrences of this word in the document" -msgstr "" - -#. DLG_Options_Label_SpellIgnoredWord -#: po/tmp/ap_String_Id.h.h:1296 -msgid "Ignored words:" -msgstr "" - -#. DLG_FormatFrame_SetImageBackground -#. DLG_FormatTable_SetImageBackground -#: po/tmp/ap_String_Id.h.h:1299 -msgid "Image For Background" -msgstr "" - -#. DLG_Lists_Implies_List -#. STYLE_IMPLIES_LIST -#: po/tmp/ap_String_Id.h.h:1301 po/tmp/xap_String_Id.h.h:433 -msgid "Implies List" -msgstr "" - -#. MENU_STATUSLINE_FILE_IMPORTSTYLES -#: po/tmp/ap_String_Id.h.h:1303 -msgid "Import style definitions from a document" -msgstr "" - -#. DLG_Styles_LBL_InUse -#: po/tmp/ap_String_Id.h.h:1305 -msgid "In Use" -msgstr "" - -#. WORD_PassInvalid -#: po/tmp/ap_String_Id.h.h:1307 -msgid "Incorrect Password" -msgstr "" - -#. TOOLBAR_LABEL_INDENT -#. TOOLBAR_STATUSLINE_INDENT -#. TOOLBAR_TOOLTIP_INDENT -#: po/tmp/ap_String_Id.h.h:1311 -msgid "Increase indent" -msgstr "" - -#. DLG_Para_LabelIndentation -#: po/tmp/ap_String_Id.h.h:1313 -msgid "Indentation" -msgstr "" - -#. DLG_Para_TabLabelIndentsAndSpacing -#: po/tmp/ap_String_Id.h.h:1315 -msgid "Indents and Spacing" -msgstr "" - -#. DLG_ToggleCase_FirstUpperCase -#: po/tmp/ap_String_Id.h.h:1317 -msgid "Initial Caps" -msgstr "" - -#. DLG_FormatFootnotes_EndInitialVal -#: po/tmp/ap_String_Id.h.h:1319 -msgid "Initial Endnote value" -msgstr "" - -#. DLG_FormatFootnotes_FootInitialVal -#: po/tmp/ap_String_Id.h.h:1321 -msgid "Initial Footnote value" -msgstr "" - -#. DLG_Break_Insert -#. MENU_STATUSLINE_TABLE_INSERT -#. DLG_IP_Button_Label -#: po/tmp/ap_String_Id.h.h:1324 po/tmp/xap_String_Id.h.h:443 -msgid "Insert" -msgstr "" - -#. MENU_LABEL_TABLE_INSERTCOLUMN -#: po/tmp/ap_String_Id.h.h:1326 -msgid "Insert &Columns" -msgstr "" - -#. MENU_LABEL_TABLE_INSERTROW -#: po/tmp/ap_String_Id.h.h:1328 -msgid "Insert &Rows" -msgstr "" - -#. MENU_LABEL_TABLE_INSERTTABLE -#: po/tmp/ap_String_Id.h.h:1330 -msgid "Insert &Table" -msgstr "" - -#. DLG_InsertBookmark_Title -#. TOOLBAR_LABEL_FMT_BOOKMARK -#: po/tmp/ap_String_Id.h.h:1333 -msgid "Insert Bookmark" -msgstr "" - -#. DLG_Break_BreakTitle_Capital -#: po/tmp/ap_String_Id.h.h:1335 -msgid "Insert Break" -msgstr "" - -#. MENU_STATUSLINE_TABLE_INSERT_CELLS -#: po/tmp/ap_String_Id.h.h:1337 -msgid "Insert Cells" -msgstr "" - -#. MENU_STATUSLINE_EDIT_PASTE -#: po/tmp/ap_String_Id.h.h:1339 -msgid "Insert Clipboard contents" -msgstr "" - -#. DLG_DateTime_DateTimeTitle -#: po/tmp/ap_String_Id.h.h:1341 -msgid "Insert Date and Time" -msgstr "" - -#. MENU_LABEL_TOOLTIP_INSERT_EQUATION -#: po/tmp/ap_String_Id.h.h:1343 -msgid "Insert Equation" -msgstr "" - -#. MENU_LABEL_TOOLTIP_INSERT_EQUATION_LATEX -#: po/tmp/ap_String_Id.h.h:1345 -msgid "Insert Equation from a LaTeX expression" -msgstr "" - -#. DLG_Field_FieldTitle_Capital -#: po/tmp/ap_String_Id.h.h:1347 -msgid "Insert Field" -msgstr "" - -#. DLG_InsertHyperlink_Title -#. TOOLBAR_LABEL_FMT_HYPERLINK -#: po/tmp/ap_String_Id.h.h:1350 -msgid "Insert Hyperlink" -msgstr "" - -#. TOOLBAR_LABEL_IMG -#: po/tmp/ap_String_Id.h.h:1352 -msgid "Insert Image" -msgstr "" - -#. DLG_MailMerge_MailMergeTitle -#: po/tmp/ap_String_Id.h.h:1354 -msgid "Insert Mail Merge Field" -msgstr "" - -#. MENU_LABEL_TOOLTIP_INSERT_EQUATION_FILE -#: po/tmp/ap_String_Id.h.h:1356 -msgid "Insert MathML from a file" -msgstr "" - -#. DLG_InsertTable_TableTitle -#. MENU_STATUSLINE_TABLE_INSERT_TABLE -#. MENU_STATUSLINE_TABLE_INSERTTABLE -#: po/tmp/ap_String_Id.h.h:1360 -msgid "Insert Table" -msgstr "" - -#. MENU_STATUSLINE_INSERT_DIRECTIONMARKER -#: po/tmp/ap_String_Id.h.h:1362 -msgid "Insert Unicode direction marker into the document" -msgstr "" - -#. MENU_STATUSLINE_INSERT_FOOTER -#: po/tmp/ap_String_Id.h.h:1364 -msgid "Insert a Footer" -msgstr "" - -#. MENU_STATUSLINE_INSERT_HEADER -#: po/tmp/ap_String_Id.h.h:1366 -msgid "Insert a Header" -msgstr "" - -#. MENU_STATUSLINE_INSERT_TABLEOFCONTENTS -#: po/tmp/ap_String_Id.h.h:1368 -msgid "Insert a Table of Contents based on Headings" -msgstr "" - -#. MENU_STATUSLINE_INSERT_TEXTBOX -#: po/tmp/ap_String_Id.h.h:1370 -msgid "Insert a Text Box" -msgstr "" - -#. TOOLBAR_STATUSLINE_FMT_BOOKMARK -#. TOOLBAR_TOOLTIP_FMT_BOOKMARK -#: po/tmp/ap_String_Id.h.h:1373 -msgid "Insert a bookmark into the document" -msgstr "" - -#. MENU_STATUSLINE_INSERT_FIELD -#: po/tmp/ap_String_Id.h.h:1375 -msgid "Insert a calculated field" -msgstr "" - -#. MENU_STATUSLINE_TABLE_INSERT_COLUMNS_BEFORE -#: po/tmp/ap_String_Id.h.h:1377 -msgid "Insert a column to the left" -msgstr "" - -#. MENU_STATUSLINE_TABLE_INSERT_COLUMNS_AFTER -#. MENU_STATUSLINE_TABLE_INSERTCOLUMN -#: po/tmp/ap_String_Id.h.h:1380 -msgid "Insert a column to the right" -msgstr "" - -#. MENU_STATUSLINE_INSERT_FOOTNOTE -#: po/tmp/ap_String_Id.h.h:1382 -msgid "Insert a footnote" -msgstr "" - -#. TOOLBAR_STATUSLINE_FMT_HYPERLINK -#. TOOLBAR_TOOLTIP_FMT_HYPERLINK -#: po/tmp/ap_String_Id.h.h:1385 -msgid "Insert a hyperlink into the document" -msgstr "" - -#. MENU_STATUSLINE_INSERT_MAILMERGE -#: po/tmp/ap_String_Id.h.h:1387 -msgid "Insert a mail merge field" -msgstr "" - -#. TOOLBAR_STATUSLINE_INSERT_TABLE -#. TOOLBAR_TOOLTIP_INSERT_TABLE -#: po/tmp/ap_String_Id.h.h:1390 -msgid "Insert a new table into your document" -msgstr "" - -#. MENU_STATUSLINE_INSERT_BREAK -#: po/tmp/ap_String_Id.h.h:1392 -msgid "Insert a page, column, or section break" -msgstr "" - -#. MENU_STATUSLINE_TABLE_INSERT_ROWS_BEFORE -#: po/tmp/ap_String_Id.h.h:1394 -msgid "Insert a row above" -msgstr "" - -#. MENU_STATUSLINE_TABLE_INSERT_ROWS_AFTER -#. MENU_STATUSLINE_TABLE_INSERTROW -#: po/tmp/ap_String_Id.h.h:1397 -msgid "Insert a row below" -msgstr "" - -#. MENU_STATUSLINE_INSERT_SYMBOL -#: po/tmp/ap_String_Id.h.h:1399 -msgid "Insert a symbol or other special character" -msgstr "" - -#. MENU_STATUSLINE_INSERT_ANNOTATION -#: po/tmp/ap_String_Id.h.h:1401 -msgid "Insert an Annotation" -msgstr "" - -#. MENU_STATUSLINE_INSERT_PAGENO -#: po/tmp/ap_String_Id.h.h:1403 -msgid "Insert an automatically-updated page number" -msgstr "" - -#. MENU_STATUSLINE_INSERT_ENDNOTE -#: po/tmp/ap_String_Id.h.h:1405 -msgid "Insert an endnote" -msgstr "" - -#. MENU_STATUSLINE_INSERT_GRAPHIC -#: po/tmp/ap_String_Id.h.h:1407 -msgid "Insert an existing picture from another file" -msgstr "" - -#. TOOLBAR_STATUSLINE_IMG -#. TOOLBAR_TOOLTIP_IMG -#: po/tmp/ap_String_Id.h.h:1410 -msgid "Insert an image into the document" -msgstr "" - -#. MENU_STATUSLINE_INSERT_BOOKMARK -#: po/tmp/ap_String_Id.h.h:1412 -msgid "Insert bookmark" -msgstr "" - -#. DLG_Break_BreakTitle -#: po/tmp/ap_String_Id.h.h:1414 -msgid "Insert break" -msgstr "" - -#. MENU_STATUSLINE_INSERT_CLIPART -#: po/tmp/ap_String_Id.h.h:1416 -msgid "Insert clipart" -msgstr "" - -#. DLG_Field_FieldTitle -#: po/tmp/ap_String_Id.h.h:1418 -msgid "Insert field" -msgstr "" - -#. MENU_STATUSLINE_INSERT_HYPERLINK -#: po/tmp/ap_String_Id.h.h:1420 -msgid "Insert hyperlink" -msgstr "" - -#. MENU_STATUSLINE_INSERT_DIRECTIONMARKER_LRM -#: po/tmp/ap_String_Id.h.h:1422 -msgid "Insert left-to-right direction marker (LRM)" -msgstr "" - -#. MENU_STATUSLINE_INSERT_DIRECTIONMARKER_RLM -#: po/tmp/ap_String_Id.h.h:1424 -msgid "Insert right-to-left direction marker (RLM)" -msgstr "" - -#. TOOLBAR_STATUSLINE_INSERT_SYMBOL -#. TOOLBAR_TOOLTIP_INSERT_SYMBOL -#: po/tmp/ap_String_Id.h.h:1427 -msgid "Insert symbol" -msgstr "" - -#. TOOLBAR_LABEL_INSERT_TABLE -#: po/tmp/ap_String_Id.h.h:1429 -msgid "Insert table" -msgstr "" - -#. MENU_STATUSLINE_TABLE_INSERT_SUMROWS -#: po/tmp/ap_String_Id.h.h:1431 -msgid "Insert the Sum of a Table Column" -msgstr "" - -#. MENU_STATUSLINE_TABLE_INSERT_SUMCOLS -#: po/tmp/ap_String_Id.h.h:1433 -msgid "Insert the Sum of a Table Row" -msgstr "" - -#. MENU_STATUSLINE_INSERT_FILE -#: po/tmp/ap_String_Id.h.h:1435 -msgid "Insert the contents of another file" -msgstr "" - -#. MENU_STATUSLINE_INSERT_DATETIME -#: po/tmp/ap_String_Id.h.h:1437 -msgid "Insert the date and/or time" -msgstr "" - -#. MENU_STATUSLINE_EDIT_PASTE_SPECIAL -#: po/tmp/ap_String_Id.h.h:1439 -msgid "Insert unformatted clipboard contents" -msgstr "" - -#. DLG_Options_Label_ViewUnprintable -#: po/tmp/ap_String_Id.h.h:1441 -msgid "Invisible &Layout Marks" -msgstr "" - -#. TOOLBAR_LABEL_FMT_ITALIC -#. TOOLBAR_STATUSLINE_FMT_ITALIC -#. TOOLBAR_TOOLTIP_FMT_ITALIC -#. DLG_UFS_StyleItalic -#: po/tmp/ap_String_Id.h.h:1445 po/tmp/xap_String_Id.h.h:473 -msgid "Italic" -msgstr "" - -#. MENU_STATUSLINE_INSERT_GOTO_HYPERLINK -#: po/tmp/ap_String_Id.h.h:1447 -msgid "Jump to hyperlink" -msgstr "" - -#. DLG_Para_AlignJustified -#: po/tmp/ap_String_Id.h.h:1449 -msgid "Justified" -msgstr "" - -#. TOOLBAR_LABEL_ALIGN_JUSTIFY -#: po/tmp/ap_String_Id.h.h:1451 -msgid "Justify" -msgstr "" - -#. TOOLBAR_STATUSLINE_ALIGN_JUSTIFY -#. TOOLBAR_TOOLTIP_ALIGN_JUSTIFY -#: po/tmp/ap_String_Id.h.h:1454 -msgid "Justify paragraph" -msgstr "" - -#. MENU_STATUSLINE_ALIGN_JUSTIFY -#: po/tmp/ap_String_Id.h.h:1456 -msgid "Justify the paragraph" -msgstr "" - -#. DLG_Para_PushKeepWithNext -#: po/tmp/ap_String_Id.h.h:1458 -msgid "Keep with ne&xt" -msgstr "" - -#. FIELD_PieceTable_Test -#: po/tmp/ap_String_Id.h.h:1460 -msgid "Kevins Test" -msgstr "" - -#. FIELD_Document_Keywords -#: po/tmp/ap_String_Id.h.h:1462 -msgid "Keywords" -msgstr "" - -#. DLG_MetaData_Keywords_LBL -#: po/tmp/ap_String_Id.h.h:1464 -msgid "Keywords:" -msgstr "" - -#. DLG_Latex_LatexTitle -#. DLG_Latex_LatexEquation -#: po/tmp/ap_String_Id.h.h:1467 -msgid "LaTeX Equation" -msgstr "" - -#. DLG_Lists_Indent -#: po/tmp/ap_String_Id.h.h:1469 -msgid "Label Align:" -msgstr "" - -#. DLG_FormatTOC_DetailsTop -#: po/tmp/ap_String_Id.h.h:1471 -msgid "Label Definitions" -msgstr "" - -#. DLG_Styles_ModifyLanguage -#. DLG_Options_Label_Language -#. FIELD_Document_Language -#: po/tmp/ap_String_Id.h.h:1475 -msgid "Language" -msgstr "" - -#. DLG_Options_Label_LangSettings -#: po/tmp/ap_String_Id.h.h:1477 -msgid "Language settings" -msgstr "" - -#. DLG_MetaData_Languages_LBL -#: po/tmp/ap_String_Id.h.h:1479 -msgid "Language(s):" -msgstr "" - -#. DLG_Options_Label_Layout -#: po/tmp/ap_String_Id.h.h:1481 -msgid "Layout" -msgstr "" - -#. DLG_FormatTOC_LayoutDetails -#: po/tmp/ap_String_Id.h.h:1483 -msgid "Layout Details" -msgstr "" - -#. DLG_Tab_Label_Leader -#: po/tmp/ap_String_Id.h.h:1485 -msgid "Leader" -msgstr "" - -#. DLG_Para_AlignLeft -#. DLG_Tab_Radio_Left -#. DLG_PageNumbers_Left -#. TOOLBAR_LABEL_ALIGN_LEFT -#: po/tmp/ap_String_Id.h.h:1490 -msgid "Left" -msgstr "" - -#. LeftIndentStatus -#: po/tmp/ap_String_Id.h.h:1492 -#, c-format -msgid "Left Indent [%s]" -msgstr "" - -#. LeftIndentTextIndentStatus -#: po/tmp/ap_String_Id.h.h:1494 -#, c-format -msgid "Left Indent [%s] First Line Indent [%s]" -msgstr "" - -#. LeftMarginStatus -#: po/tmp/ap_String_Id.h.h:1496 -#, c-format -msgid "Left Margin [%s]" -msgstr "" - -#. TabToggleLeftTab -#: po/tmp/ap_String_Id.h.h:1498 -msgid "Left Tab" -msgstr "" - -#. TOOLBAR_STATUSLINE_ALIGN_LEFT -#. TOOLBAR_TOOLTIP_ALIGN_LEFT -#: po/tmp/ap_String_Id.h.h:1501 -msgid "Left alignment" -msgstr "" - -#. MENU_STATUSLINE_ALIGN_LEFT -#: po/tmp/ap_String_Id.h.h:1503 -msgid "Left-align the paragraph" -msgstr "" - -#. DLG_FormatTOC_Level1 -#: po/tmp/ap_String_Id.h.h:1505 -msgid "Level 1" -msgstr "" - -#. DLG_FormatTOC_Level2 -#: po/tmp/ap_String_Id.h.h:1507 -msgid "Level 2" -msgstr "" - -#. DLG_FormatTOC_Level3 -#: po/tmp/ap_String_Id.h.h:1509 -msgid "Level 3" -msgstr "" - -#. DLG_FormatTOC_Level4 -#: po/tmp/ap_String_Id.h.h:1511 -msgid "Level 4" -msgstr "" - -#. DLG_Lists_DelimiterString -#: po/tmp/ap_String_Id.h.h:1513 -msgid "Level Delimiter:" -msgstr "" - -#. DLG_Lists_Level -#: po/tmp/ap_String_Id.h.h:1515 -msgid "Level:" -msgstr "" - -#. DLG_Para_LabelLineSpacing -#: po/tmp/ap_String_Id.h.h:1517 -msgid "Li&ne spacing:" -msgstr "" - -#. DLG_Goto_Target_Line -#: po/tmp/ap_String_Id.h.h:1519 -msgid "Line" -msgstr "" - -#. FIELD_Numbers_LineCount -#: po/tmp/ap_String_Id.h.h:1521 -msgid "Line Count" -msgstr "" - -#. MENU_STATUSLINE_FMT_TOPLINE -#: po/tmp/ap_String_Id.h.h:1523 -msgid "Line above the selection (toggle)" -msgstr "" - -#. DLG_Para_TabLabelLineAndPageBreaks -#: po/tmp/ap_String_Id.h.h:1525 -msgid "Line and Page Breaks" -msgstr "" - -#. MENU_STATUSLINE_FMT_BOTTOMLINE -#: po/tmp/ap_String_Id.h.h:1527 -msgid "Line below the selection (toggle)" -msgstr "" - -#. DLG_Column_Line_Between -#: po/tmp/ap_String_Id.h.h:1529 -msgid "Line between" -msgstr "" - -#. DLG_WordCount_Lines -#: po/tmp/ap_String_Id.h.h:1531 -msgid "Lines:" -msgstr "" - -#. DLG_Styles_List -#: po/tmp/ap_String_Id.h.h:1533 -msgid "List" -msgstr "" - -#. FIELD_Numbers_ListLabel -#: po/tmp/ap_String_Id.h.h:1535 -msgid "List Label" -msgstr "" - -#. DLG_Lists_PageProperties -#: po/tmp/ap_String_Id.h.h:1537 -msgid "List Properties" -msgstr "" - -#. DLG_Stylist_ListStyles -#: po/tmp/ap_String_Id.h.h:1539 -msgid "List Styles" -msgstr "" - -#. DLG_Lists_Title -#: po/tmp/ap_String_Id.h.h:1541 -msgid "Lists for " -msgstr "" - -#. MENU_STATUSLINE_VIEW_LOCK_TB_LAYOUT -#: po/tmp/ap_String_Id.h.h:1543 -msgid "Lock the layout of the current toolbars" -msgstr "" - -#. DLG_Lists_Lower_Case_List -#. STYLE_LOWERCASELIST -#: po/tmp/ap_String_Id.h.h:1545 po/tmp/xap_String_Id.h.h:512 -msgid "Lower Case List" -msgstr "" - -#. DLG_Lists_Lower_Roman_List -#. STYLE_LOWERROMANLIST -#: po/tmp/ap_String_Id.h.h:1547 po/tmp/xap_String_Id.h.h:514 -msgid "Lower Roman List" -msgstr "" - -#. FIELD_Application_MailMerge -#. MENU_STATUSLINE_TOOLS_MAILMERGE -#: po/tmp/ap_String_Id.h.h:1550 -msgid "Mail Merge" -msgstr "" - -#. MENU_STATUSLINE_FMT_BOLD -#: po/tmp/ap_String_Id.h.h:1552 -msgid "Make the selection bold (toggle)" -msgstr "" - -#. MENU_STATUSLINE_FMT_ITALIC -#: po/tmp/ap_String_Id.h.h:1554 -msgid "Make the selection italic (toggle)" -msgstr "" - -#. MENU_STATUSLINE_FMT_SUBSCRIPT -#: po/tmp/ap_String_Id.h.h:1556 -msgid "Make the selection subscript (toggle)" -msgstr "" - -#. MENU_STATUSLINE_FMT_SUPERSCRIPT -#: po/tmp/ap_String_Id.h.h:1558 -msgid "Make the selection superscript (toggle)" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS -#: po/tmp/ap_String_Id.h.h:1560 -msgid "Manage changes in document" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_PLUGINS -#: po/tmp/ap_String_Id.h.h:1562 -msgid "Manage plugins" -msgstr "" - -#. DLG_PageSetup_Margin -#: po/tmp/ap_String_Id.h.h:1564 -msgid "Margin" -msgstr "" - -#. DLG_MarkRevisions_Title -#: po/tmp/ap_String_Id.h.h:1566 -msgid "Mark Revisions" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_MARK -#: po/tmp/ap_String_Id.h.h:1568 -msgid "Mark changes as you type" -msgstr "" - -#. FIELD_PieceTable_MartinTest -#: po/tmp/ap_String_Id.h.h:1570 -msgid "Martins Test" -msgstr "" - -#. DLG_Column_Size -#: po/tmp/ap_String_Id.h.h:1572 -msgid "Max Column size" -msgstr "" - -#. TOOLBAR_LABEL_MENU -#. TOOLBAR_STATUSLINE_MENU -#. TOOLBAR_TOOLTIP_MENU -#: po/tmp/ap_String_Id.h.h:1576 -msgid "Menu" -msgstr "" - -#. DLG_MergeCells_Above -#: po/tmp/ap_String_Id.h.h:1578 -msgid "Merge Above" -msgstr "" - -#. DLG_MergeCells_Below -#: po/tmp/ap_String_Id.h.h:1580 -msgid "Merge Below" -msgstr "" - -#. DLG_MergeCellsTitle -#. DLG_MergeCells_Frame -#. MENU_STATUSLINE_TABLE_MERGE_CELLS -#: po/tmp/ap_String_Id.h.h:1584 -msgid "Merge Cells" -msgstr "" - -#. DLG_MergeCells_Left -#: po/tmp/ap_String_Id.h.h:1586 -msgid "Merge Left" -msgstr "" - -#. DLG_MergeCells_Right -#: po/tmp/ap_String_Id.h.h:1588 -msgid "Merge Right" -msgstr "" - -#. TOOLBAR_LABEL_MERGEABOVE -#: po/tmp/ap_String_Id.h.h:1590 -msgid "Merge above" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_MERGE_DOCUMENTS -#: po/tmp/ap_String_Id.h.h:1592 -msgid "Merge another document into the active document using revision marks" -msgstr "" - -#. TOOLBAR_LABEL_MERGEBELOW -#: po/tmp/ap_String_Id.h.h:1594 -msgid "Merge below" -msgstr "" - -#. TOOLBAR_LABEL_MERGE_CELLS -#. TOOLBAR_STATUSLINE_MERGE_CELLS -#. TOOLBAR_TOOLTIP_MERGE_CELLS -#: po/tmp/ap_String_Id.h.h:1598 -msgid "Merge cells" -msgstr "" - -#. TOOLBAR_LABEL_MERGELEFT -#: po/tmp/ap_String_Id.h.h:1600 -msgid "Merge left" -msgstr "" - -#. TOOLBAR_LABEL_MERGERIGHT -#: po/tmp/ap_String_Id.h.h:1602 -msgid "Merge right" -msgstr "" - -#. TOOLBAR_STATUSLINE_MERGEABOVE -#. TOOLBAR_TOOLTIP_MERGEABOVE -#: po/tmp/ap_String_Id.h.h:1605 -msgid "Merge with cell above" -msgstr "" - -#. TOOLBAR_STATUSLINE_MERGEBELOW -#. TOOLBAR_TOOLTIP_MERGEBELOW -#: po/tmp/ap_String_Id.h.h:1608 -msgid "Merge with cell below" -msgstr "" - -#. TOOLBAR_STATUSLINE_MERGELEFT -#. TOOLBAR_TOOLTIP_MERGELEFT -#: po/tmp/ap_String_Id.h.h:1611 -msgid "Merge with left cell" -msgstr "" - -#. TOOLBAR_STATUSLINE_MERGERIGHT -#. TOOLBAR_TOOLTIP_MERGERIGHT -#: po/tmp/ap_String_Id.h.h:1614 -msgid "Merge with right cell" -msgstr "" - -#. FIELD_DateTime_MilTime -#: po/tmp/ap_String_Id.h.h:1616 -msgid "Military Time" -msgstr "" - -#. DLG_Options_TabLabel_Misc -#: po/tmp/ap_String_Id.h.h:1618 -msgid "Misc." -msgstr "" - -#. DLG_Stylist_MiscStyles -#: po/tmp/ap_String_Id.h.h:1620 -msgid "Miscellaneous Styles" -msgstr "" - -#. DLG_Styles_ModifyTitle -#: po/tmp/ap_String_Id.h.h:1622 -msgid "Modify Styles" -msgstr "" - -#. DLG_Styles_Modify -#: po/tmp/ap_String_Id.h.h:1624 -msgid "Modify..." -msgstr "" - -#. FIELD_DateTime_MonthDayYear -#: po/tmp/ap_String_Id.h.h:1626 -msgid "Month Day, Year" -msgstr "" - -#. MENU_STATUSLINE_EDIT_GOTO -#: po/tmp/ap_String_Id.h.h:1628 -msgid "Move the insertion point to a specific location" -msgstr "" - -#. FIELD_DateTime_MthDayYear -#: po/tmp/ap_String_Id.h.h:1630 -msgid "Mth. Day, Year" -msgstr "" - -#. DLG_Para_SpacingMultiple -#: po/tmp/ap_String_Id.h.h:1632 -msgid "Multiple" -msgstr "" - -#. TOOLBAR_LABEL_FILE_NEW -#: po/tmp/ap_String_Id.h.h:1634 -msgid "New" -msgstr "" - -#. DLG_NEW_Title -#: po/tmp/ap_String_Id.h.h:1636 -msgid "New Document" -msgstr "" - -#. DLG_Lists_New_List_Label -#: po/tmp/ap_String_Id.h.h:1638 -msgid "New List Label" -msgstr "" - -#. DLG_Lists_New_List_Type -#: po/tmp/ap_String_Id.h.h:1640 -msgid "" -"New List \n" -"Type" -msgstr "" - -#. DLG_Lists_Starting_Value -#: po/tmp/ap_String_Id.h.h:1642 -msgid "" -"New Starting \n" -"Value" -msgstr "" - -#. DLG_Styles_NewTitle -#: po/tmp/ap_String_Id.h.h:1644 -msgid "New Style" -msgstr "" - -#. DLG_Styles_New -#: po/tmp/ap_String_Id.h.h:1646 -msgid "New..." -msgstr "" - -#. DLG_Goto_Btn_Next -#: po/tmp/ap_String_Id.h.h:1648 -msgid "Next >>" -msgstr "" - -#. DLG_NEW_NoFile -#: po/tmp/ap_String_Id.h.h:1650 -msgid "No File" -msgstr "" - -#. DLG_Lists_FoldingLevel0 -#: po/tmp/ap_String_Id.h.h:1652 -msgid "No Folding" -msgstr "" - -#. DLG_Styles_ErrNoStyle -#: po/tmp/ap_String_Id.h.h:1654 -msgid "" -"No Style selected \n" -" so it cannot be modified" -msgstr "" - -#. SCRIPT_NOSCRIPTS -#: po/tmp/ap_String_Id.h.h:1656 -msgid "No scripts found" -msgstr "" - -#. DLG_FormatTOC_None -#. DLG_Styles_DefNone -#. DLG_Tab_Radio_NoAlign -#. DLG_Lists_Type_none -#: po/tmp/ap_String_Id.h.h:1661 -msgid "None" -msgstr "" - -#. TOOLBAR_LABEL_PARA_0BEFORE -#: po/tmp/ap_String_Id.h.h:1663 -msgid "None before" -msgstr "" - -#. MENU_STATUSLINE_VIEW_NORMAL -#: po/tmp/ap_String_Id.h.h:1665 -msgid "Normal View" -msgstr "" - -#. DLG_Spell_UnknownWord -#: po/tmp/ap_String_Id.h.h:1667 -msgid "Not in dictionary&:" -msgstr "" - -#. DLG_Stylist_FootnoteStyles -#: po/tmp/ap_String_Id.h.h:1669 -msgid "Note Styles" -msgstr "" - -#. DLG_Column_Number_Cols -#: po/tmp/ap_String_Id.h.h:1671 -msgid "Number of Columns" -msgstr "" - -#. FIELD_Numbers_PagesCount -#: po/tmp/ap_String_Id.h.h:1673 -msgid "Number of Pages" -msgstr "" - -#. DLG_Column_Number -#: po/tmp/ap_String_Id.h.h:1675 -msgid "Number of columns" -msgstr "" - -#. DLG_InsertTable_NumCols -#: po/tmp/ap_String_Id.h.h:1677 -msgid "Number of columns:" -msgstr "" - -#. DLG_InsertTable_NumRows -#: po/tmp/ap_String_Id.h.h:1679 -msgid "Number of rows:" -msgstr "" - -#. DLG_Lists_Type_numbered -#: po/tmp/ap_String_Id.h.h:1681 -msgid "Numbered" -msgstr "" - -#. DLG_Lists_Numbered_List -#. STYLE_NUMBER_LIST -#: po/tmp/ap_String_Id.h.h:1683 po/tmp/xap_String_Id.h.h:558 -msgid "Numbered List" -msgstr "" - -#. DLG_FormatFootnotes_FootnoteRestart -#. DLG_Styles_ModifyNumbering -#. TOOLBAR_LABEL_LISTS_NUMBERS -#. TOOLBAR_STATUSLINE_LISTS_NUMBERS -#. TOOLBAR_TOOLTIP_LISTS_NUMBERS -#: po/tmp/ap_String_Id.h.h:1689 -msgid "Numbering" -msgstr "" - -#. FIELD_Type_Numbers -#: po/tmp/ap_String_Id.h.h:1691 -msgid "Numbers" -msgstr "" - -#. InsertModeFieldOVR -#: po/tmp/ap_String_Id.h.h:1693 -msgid "OVR" -msgstr "" - -#. DLG_Column_One -#: po/tmp/ap_String_Id.h.h:1695 -msgid "One" -msgstr "" - -#. MENU_LABEL_FILE_IMPORT -#: po/tmp/ap_String_Id.h.h:1697 -msgid "Op&en Copy" -msgstr "" - -#. TOOLBAR_LABEL_FILE_OPEN -#: po/tmp/ap_String_Id.h.h:1699 -msgid "Open" -msgstr "" - -#. MENU_LABEL_OPEN_TEMPLATE -#: po/tmp/ap_String_Id.h.h:1701 -msgid "Open Template" -msgstr "" - -#. MENU_STATUSLINE_FILE_IMPORT -#: po/tmp/ap_String_Id.h.h:1703 -msgid "Open a document by making a copy" -msgstr "" - -#. MENU_STATUSLINE_FILE_RECENT -#: po/tmp/ap_String_Id.h.h:1705 -msgid "Open a recently used document" -msgstr "" - -#. DLG_NEW_Open -#. MENU_STATUSLINE_FILE_OPEN -#. TOOLBAR_STATUSLINE_FILE_OPEN -#. TOOLBAR_TOOLTIP_FILE_OPEN -#: po/tmp/ap_String_Id.h.h:1710 -msgid "Open an existing document" -msgstr "" - -#. MENU_STATUSLINE_WINDOW_NEW -#: po/tmp/ap_String_Id.h.h:1712 -msgid "Open another window for the document" -msgstr "" - -#. MENU_STATUSLINE_FILE_RECENT_1 -#. MENU_STATUSLINE_FILE_RECENT_2 -#. MENU_STATUSLINE_FILE_RECENT_3 -#. MENU_STATUSLINE_FILE_RECENT_4 -#. MENU_STATUSLINE_FILE_RECENT_5 -#. MENU_STATUSLINE_FILE_RECENT_6 -#. MENU_STATUSLINE_FILE_RECENT_7 -#. MENU_STATUSLINE_FILE_RECENT_8 -#. MENU_STATUSLINE_FILE_RECENT_9 -#: po/tmp/ap_String_Id.h.h:1722 -msgid "Open this document" -msgstr "" - -#. DLG_PageSetup_Orient -#: po/tmp/ap_String_Id.h.h:1724 -msgid "Orientation..." -msgstr "" - -#. DLG_Options_TabLabel_Other -#: po/tmp/ap_String_Id.h.h:1726 -msgid "Other" -msgstr "" - -#. MSG_IE_NoMemory -#: po/tmp/ap_String_Id.h.h:1728 -#, c-format -msgid "Out of memory attempting to open %s" -msgstr "" - -#. TOOLBAR_LABEL_FMT_OVERLINE -#. TOOLBAR_STATUSLINE_FMT_OVERLINE -#. TOOLBAR_TOOLTIP_FMT_OVERLINE -#. DLG_UFS_OverlineCheck -#: po/tmp/ap_String_Id.h.h:1732 po/tmp/xap_String_Id.h.h:572 -msgid "Overline" -msgstr "" - -#. MENU_STATUSLINE_FMT_OVERLINE -#: po/tmp/ap_String_Id.h.h:1734 -msgid "Overline the selection (toggle)" -msgstr "" - -#. MENU_LABEL_FILE_PROPERTIES -#: po/tmp/ap_String_Id.h.h:1736 -msgid "P&roperties" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_PURGE -#: po/tmp/ap_String_Id.h.h:1738 -msgid "P&urge revisions" -msgstr "" - -#. MENU_LABEL_EDIT_PASTE_SPECIAL -#: po/tmp/ap_String_Id.h.h:1740 -msgid "Pa&ste Unformatted" -msgstr "" - -#. DLG_Goto_Target_Page -#. DLG_PageSetup_Page -#: po/tmp/ap_String_Id.h.h:1743 -msgid "Page" -msgstr "" - -#. DLG_Para_PushPageBreakBefore -#: po/tmp/ap_String_Id.h.h:1745 -msgid "Page &break before" -msgstr "" - -#. MENU_LABEL_FMT_BACKGROUND -#: po/tmp/ap_String_Id.h.h:1747 -msgid "Page Background" -msgstr "" - -#. MENU_LABEL_FMT_BACKGROUND_PAGE_COLOR -#: po/tmp/ap_String_Id.h.h:1749 -msgid "Page C&olor" -msgstr "" - -#. MENU_LABEL_FMT_BACKGROUND_PAGE_IMAGE -#: po/tmp/ap_String_Id.h.h:1751 -msgid "Page Image" -msgstr "" - -#. MENU_LABEL_INSERT_PAGENO -#: po/tmp/ap_String_Id.h.h:1753 -msgid "Page N&umbers" -msgstr "" - -#. FIELD_Numbers_PageNumber -#: po/tmp/ap_String_Id.h.h:1755 -msgid "Page Number" -msgstr "" - -#. DLG_HdrFtr_PageNumberProperties -#: po/tmp/ap_String_Id.h.h:1757 -msgid "Page Number Properties" -msgstr "" - -#. DLG_PageNumbers_Title -#: po/tmp/ap_String_Id.h.h:1759 -msgid "Page Numbers" -msgstr "" - -#. FIELD_Numbers_PageReference -#: po/tmp/ap_String_Id.h.h:1761 -msgid "Page Reference" -msgstr "" - -#. MENU_LABEL_FILE_PAGESETUP -#: po/tmp/ap_String_Id.h.h:1763 -msgid "Page Set&up" -msgstr "" - -#. DLG_PageSetup_Title -#: po/tmp/ap_String_Id.h.h:1765 -msgid "Page Setup" -msgstr "" - -#. PageInfoField -#: po/tmp/ap_String_Id.h.h:1767 -#, c-format -msgid "Page: %d/%d" -msgstr "" - -#. DLG_WordCount_Pages -#: po/tmp/ap_String_Id.h.h:1769 -msgid "Pages:" -msgstr "" - -#. DLG_Para_LabelPagination -#: po/tmp/ap_String_Id.h.h:1771 -msgid "Pagination" -msgstr "" - -#. DLG_PageSetup_Paper_Size -#: po/tmp/ap_String_Id.h.h:1773 -msgid "Paper Si&ze:" -msgstr "" - -#. DLG_PageSetup_Paper -#: po/tmp/ap_String_Id.h.h:1775 -msgid "Paper..." -msgstr "" - -#. DLG_Styles_ModifyParagraph -#. DLG_Para_ParaTitle -#: po/tmp/ap_String_Id.h.h:1778 -msgid "Paragraph" -msgstr "" - -#. FIELD_Numbers_ParaCount -#: po/tmp/ap_String_Id.h.h:1780 -msgid "Paragraph Count" -msgstr "" - -#. TOOLBAR_LABEL_FMT_DOM_DIRECTION -#: po/tmp/ap_String_Id.h.h:1782 -msgid "Paragraph Direction" -msgstr "" - -#. DLG_Styles_ParaPrev -#: po/tmp/ap_String_Id.h.h:1784 -msgid "Paragraph Preview" -msgstr "" - -#. DLG_WordCount_Paragraphs -#: po/tmp/ap_String_Id.h.h:1786 -msgid "Paragraphs:" -msgstr "" - -#. WORD_PassRequired -#: po/tmp/ap_String_Id.h.h:1788 -msgid "Password required, this is an encrypted document" -msgstr "" - -#. TOOLBAR_LABEL_EDIT_PASTE -#. TOOLBAR_STATUSLINE_EDIT_PASTE -#. TOOLBAR_TOOLTIP_EDIT_PASTE -#: po/tmp/ap_String_Id.h.h:1792 -msgid "Paste" -msgstr "" - -#. DLG_MetaData_TAB_Permission -#: po/tmp/ap_String_Id.h.h:1794 -msgid "Permissions" -msgstr "" - -#. DLG_Goto_Target_Picture -#: po/tmp/ap_String_Id.h.h:1796 -msgid "Picture" -msgstr "" - -#. FIELD_Type_PieceTable -#: po/tmp/ap_String_Id.h.h:1798 -msgid "Piece Table" -msgstr "" - -#. DLG_FormatFootnotes_EndPlaceEndDoc -#: po/tmp/ap_String_Id.h.h:1800 -msgid "Place at end of document" -msgstr "" - -#. DLG_FormatFootnotes_EndPlaceEndSec -#: po/tmp/ap_String_Id.h.h:1802 -msgid "Place at end of section" -msgstr "" - -#. DLG_FormatFootnotes_EndPlacement -#: po/tmp/ap_String_Id.h.h:1804 -msgid "Placement" -msgstr "" - -#. DLG_Tab_Label_Position -#. DLG_PageNumbers_Position_No_Colon -#: po/tmp/ap_String_Id.h.h:1807 -msgid "Position" -msgstr "" - -#. DLG_FormatFrame_PositionTo -#: po/tmp/ap_String_Id.h.h:1809 -msgid "Position Text Box" -msgstr "" - -#. DLG_FormatFrame_SetToColumn -#: po/tmp/ap_String_Id.h.h:1811 -msgid "Position to Column" -msgstr "" - -#. DLG_FormatFrame_SetToPage -#: po/tmp/ap_String_Id.h.h:1813 -msgid "Position to Page" -msgstr "" - -#. DLG_FormatFrame_SetToParagraph -#: po/tmp/ap_String_Id.h.h:1815 -msgid "Position to Paragraph" -msgstr "" - -#. DLG_PageNumbers_Position -#: po/tmp/ap_String_Id.h.h:1817 -msgid "Position:" -msgstr "" - -#. MENU_LABEL_TOOLS_OPTIONS -#: po/tmp/ap_String_Id.h.h:1819 -msgid "Pr&eferences" -msgstr "" - -#. DLG_Options_TabLabel_Preferences -#. DLG_Options_Label_Schemes -#: po/tmp/ap_String_Id.h.h:1822 -msgid "Preference Schemes" -msgstr "" - -#. DLG_Options_OptionsTitle -#: po/tmp/ap_String_Id.h.h:1824 -msgid "Preferences" -msgstr "" - -#. DLG_Styles_ModifyPreview -#. DLG_Para_LabelPreview -#. DLG_Column_Preview -#. DLG_FormatFrame_Preview -#. DLG_FormatTable_Preview -#. DLG_Lists_Preview -#. DLG_PageNumbers_Preview -#. DLG_Zoom_PreviewFrame -#: po/tmp/ap_String_Id.h.h:1832 po/tmp/xap_String_Id.h.h:604 -msgid "Preview" -msgstr "" - -#. MENU_STATUSLINE_WEB_WEBPREVIEW -#. MENU_STATUSLINE_WEB_SAVEASWEB -#: po/tmp/ap_String_Id.h.h:1835 -msgid "Preview the document as a web page" -msgstr "" - -#. MENU_STATUSLINE_FILE_PRINT_PREVIEW -#. TOOLBAR_STATUSLINE_FILE_PRINT_PREVIEW -#. TOOLBAR_TOOLTIP_FILE_PRINT_PREVIEW -#: po/tmp/ap_String_Id.h.h:1839 -msgid "Preview the document before printing" -msgstr "" - -#. DLG_Para_PreviewPrevParagraph -#: po/tmp/ap_String_Id.h.h:1841 -msgid "" -"Previous Paragraph Previous Paragraph Previous Paragraph Previous Paragraph " -"Previous Paragraph Previous Paragraph Previous Paragraph" -msgstr "" - -#. TOOLBAR_LABEL_FILE_PRINT -#. DLG_UP_PrintTitle -#. DLG_UP_PrintButton -#: po/tmp/ap_String_Id.h.h:1843 po/tmp/xap_String_Id.h.h:609 -msgid "Print" -msgstr "" - -#. MENU_LABEL_FILE_PRINT_DIRECTLY -#: po/tmp/ap_String_Id.h.h:1845 -msgid "Print &directly" -msgstr "" - -#. MENU_STATUSLINE_VIEW_PRINT -#: po/tmp/ap_String_Id.h.h:1847 -msgid "Print Layout" -msgstr "" - -#. MENU_LABEL_FILE_PRINT_PREVIEW -#: po/tmp/ap_String_Id.h.h:1849 -msgid "Print P&review" -msgstr "" - -#. TOOLBAR_LABEL_FILE_PRINT_PREVIEW -#: po/tmp/ap_String_Id.h.h:1851 -msgid "Print Preview" -msgstr "" - -#. MENU_STATUSLINE_FILE_PRINT -#: po/tmp/ap_String_Id.h.h:1853 -msgid "Print all or part of the document" -msgstr "" - -#. TOOLBAR_STATUSLINE_FILE_PRINT -#. TOOLBAR_TOOLTIP_FILE_PRINT -#: po/tmp/ap_String_Id.h.h:1856 -msgid "Print the document" -msgstr "" - -#. MENU_STATUSLINE_FILE_PRINT_DIRECTLY -#: po/tmp/ap_String_Id.h.h:1858 -msgid "Print using the internal PS driver" -msgstr "" - -#. MSG_PrintingDoc -#: po/tmp/ap_String_Id.h.h:1860 -msgid "Printing Document.." -msgstr "" - -#. MSG_PrintStatus -#: po/tmp/ap_String_Id.h.h:1862 -#, c-format -msgid "Printing page %d of %d" -msgstr "" - -#. FIELD_Document_Publisher -#: po/tmp/ap_String_Id.h.h:1864 -msgid "Publisher" -msgstr "" - -#. DLG_MetaData_Publisher_LBL -#: po/tmp/ap_String_Id.h.h:1866 -msgid "Publisher:" -msgstr "" - -#. MENU_LABEL_EDIT_REPLACE -#: po/tmp/ap_String_Id.h.h:1868 -msgid "R&eplace" -msgstr "" - -#. MENU_LABEL_FMT_DIRECTION_DOCD_RTL -#: po/tmp/ap_String_Id.h.h:1870 -msgid "RTL &Document" -msgstr "" - -#. MENU_LABEL_FMT_DIRECTION_DD_RTL -#: po/tmp/ap_String_Id.h.h:1872 -msgid "RTL &Paragraph" -msgstr "" - -#. MENU_LABEL_FMT_DIRECTION_SD_RTL -#: po/tmp/ap_String_Id.h.h:1874 -msgid "RTL &Section" -msgstr "" - -#. DLG_FR_ReplaceWithLabel -#: po/tmp/ap_String_Id.h.h:1876 -msgid "Re&place with:" -msgstr "" - -#. DLG_FR_ReverseFind -#: po/tmp/ap_String_Id.h.h:1878 -msgid "Re&verse find" -msgstr "" - -#. MENU_LABEL_FILE_REVERT -#: po/tmp/ap_String_Id.h.h:1880 -msgid "Re&vert" -msgstr "" - -#. MENU_LABEL_FILE_RECENT -#: po/tmp/ap_String_Id.h.h:1882 -msgid "Recent &Files" -msgstr "" - -#. TOOLBAR_LABEL_EDIT_REDO -#: po/tmp/ap_String_Id.h.h:1884 -msgid "Redo" -msgstr "" - -#. TOOLBAR_STATUSLINE_EDIT_REDO -#. TOOLBAR_TOOLTIP_EDIT_REDO -#: po/tmp/ap_String_Id.h.h:1887 -msgid "Redo editing" -msgstr "" - -#. MENU_STATUSLINE_EDIT_REDO -#: po/tmp/ap_String_Id.h.h:1889 -msgid "Redo previously undone editing" -msgstr "" - -#. MENU_STATUSLINE_VIEW_ZOOM_MENU -#. MENU_STATUSLINE_VIEW_ZOOM -#: po/tmp/ap_String_Id.h.h:1892 -msgid "Reduce or enlarge the document display" -msgstr "" - -#. DLG_MetaData_Relation_LBL -#: po/tmp/ap_String_Id.h.h:1894 -msgid "Relation:" -msgstr "" - -#. DLG_Styles_RemoveButton -#: po/tmp/ap_String_Id.h.h:1896 -msgid "Remove" -msgstr "" - -#. MENU_LABEL_EDIT_REMOVEFOOTER -#. TOOLBAR_LABEL_EDIT_REMOVEFOOTER -#. TOOLBAR_STATUSLINE_EDIT_REMOVEFOOTER -#. TOOLBAR_TOOLTIP_EDIT_REMOVEFOOTER -#: po/tmp/ap_String_Id.h.h:1901 -msgid "Remove Footer" -msgstr "" - -#. MENU_LABEL_EDIT_REMOVEHEADER -#. TOOLBAR_LABEL_EDIT_REMOVEHEADER -#. TOOLBAR_STATUSLINE_EDIT_REMOVEHEADER -#. TOOLBAR_TOOLTIP_EDIT_REMOVEHEADER -#: po/tmp/ap_String_Id.h.h:1906 -msgid "Remove Header" -msgstr "" - -#. DLG_Styles_RemoveLab -#: po/tmp/ap_String_Id.h.h:1908 -msgid "Remove Property from Style" -msgstr "" - -#. MENU_LABEL_TABLE_HEADING_ROWS_REPEAT_REMOVE -#: po/tmp/ap_String_Id.h.h:1910 -msgid "Remove Row as Heading" -msgstr "" - -#. MENU_STATUSLINE_TABLE_HEADING_ROWS_REPEAT_REMOVE -#: po/tmp/ap_String_Id.h.h:1912 -msgid "Remove Row as the page Heading" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_PURGE -#: po/tmp/ap_String_Id.h.h:1914 -msgid "Remove all revision information from the document" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_HISTORY_PURGE -#: po/tmp/ap_String_Id.h.h:1916 -msgid "Remove full document history from the document" -msgstr "" - -#. MENU_STATUSLINE_EDIT_REMOVEFOOTER -#: po/tmp/ap_String_Id.h.h:1918 -msgid "Remove the Footer on this page from the Document" -msgstr "" - -#. MENU_STATUSLINE_EDIT_REMOVEHEADER -#: po/tmp/ap_String_Id.h.h:1920 -msgid "Remove the Header on this page from the Document" -msgstr "" - -#. MENU_STATUSLINE_EDIT_CUTIMAGE -#: po/tmp/ap_String_Id.h.h:1922 -msgid "Remove the Image and save a copy on the clipboard" -msgstr "" - -#. MENU_STATUSLINE_EDIT_DELETEIMAGE -#: po/tmp/ap_String_Id.h.h:1924 -msgid "Remove the Image from the Document" -msgstr "" - -#. MENU_STATUSLINE_EDIT_DELETEFRAME -#: po/tmp/ap_String_Id.h.h:1926 -msgid "Remove the Text Box from the Document" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_REJECT_REVISION -#: po/tmp/ap_String_Id.h.h:1928 -msgid "Remove the suggested change" -msgstr "" - -#. MENU_LABEL_TABLE_HEADING_ROWS_REPEAT -#: po/tmp/ap_String_Id.h.h:1930 -msgid "Repeat Row as Heading" -msgstr "" - -#. MENU_STATUSLINE_TABLE_HEADING_ROWS_REPEAT -#: po/tmp/ap_String_Id.h.h:1932 -msgid "Repeat Row as Heading on each new page" -msgstr "" - -#. DLG_FR_ReplaceTitle -#: po/tmp/ap_String_Id.h.h:1934 -msgid "Replace" -msgstr "" - -#. DLG_FR_ReplaceAllButton -#: po/tmp/ap_String_Id.h.h:1936 -msgid "Replace &All" -msgstr "" - -#. MENU_STATUSLINE_EDIT_REPLACE -#: po/tmp/ap_String_Id.h.h:1938 -msgid "Replace the specified text with different text" -msgstr "" - -#. MENU_LABEL_HELP_REPORT_BUG -#: po/tmp/ap_String_Id.h.h:1940 -msgid "Report a &Bug" -msgstr "" - -#. MENU_STATUSLINE_HELP_REPORT_BUG -#: po/tmp/ap_String_Id.h.h:1942 -msgid "Report a bug and help AbiWord become a better product" -msgstr "" - -#. MENU_STATUSLINE_VIEW_DEFAULT_TB_LAYOUT -#: po/tmp/ap_String_Id.h.h:1944 -msgid "Reset the current toolbar layout to its defaults" -msgstr "" - -#. MENU_STATUSLINE_FMT_IMAGE -#: po/tmp/ap_String_Id.h.h:1946 -msgid "Resize this image" -msgstr "" - -#. DLG_HdrFtr_RestartNumbers -#: po/tmp/ap_String_Id.h.h:1948 -msgid "Restart numbering at:" -msgstr "" - -#. DLG_FormatFootnotes_FootRestartPage -#: po/tmp/ap_String_Id.h.h:1950 -msgid "Restart on each page" -msgstr "" - -#. DLG_FormatFootnotes_FootRestartSec -#. DLG_FormatFootnotes_EndRestartSec -#: po/tmp/ap_String_Id.h.h:1953 -msgid "Restart on each section" -msgstr "" - -#. DLG_HdrFtr_RestartCheck -#: po/tmp/ap_String_Id.h.h:1955 -msgid "Restart page numbers on new sections" -msgstr "" - -#. DLG_Lists_Resume_Previous_List -#: po/tmp/ap_String_Id.h.h:1957 -msgid "Resume Previous List" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_AUTO -#: po/tmp/ap_String_Id.h.h:1959 -msgid "Retain all document changes" -msgstr "" - -#. MSG_RevertFile -#: po/tmp/ap_String_Id.h.h:1961 -msgid "Revert file to last saved state?" -msgstr "" - -#. MENU_STATUSLINE_FILE_REVERT -#: po/tmp/ap_String_Id.h.h:1963 -msgid "Revert the document to the last saved state" -msgstr "" - -#. MSG_RevertBuffer -#: po/tmp/ap_String_Id.h.h:1965 -#, c-format -msgid "Revert to saved copy of %s?" -msgstr "" - -#. DLG_ListRevisions_Column1Label -#: po/tmp/ap_String_Id.h.h:1967 -msgid "Revision ID" -msgstr "" - -#. DLG_Para_AlignRight -#. DLG_Tab_Radio_Right -#. DLG_PageNumbers_Right -#. TOOLBAR_LABEL_ALIGN_RIGHT -#: po/tmp/ap_String_Id.h.h:1972 -msgid "Right" -msgstr "" - -#. RightIndentStatus -#: po/tmp/ap_String_Id.h.h:1974 -#, c-format -msgid "Right Indent [%s]" -msgstr "" - -#. RightMarginStatus -#: po/tmp/ap_String_Id.h.h:1976 -#, c-format -msgid "Right Margin [%s]" -msgstr "" - -#. TabToggleRightTab -#: po/tmp/ap_String_Id.h.h:1978 -msgid "Right Tab" -msgstr "" - -#. TOOLBAR_STATUSLINE_ALIGN_RIGHT -#. TOOLBAR_TOOLTIP_ALIGN_RIGHT -#: po/tmp/ap_String_Id.h.h:1981 -msgid "Right alignment" -msgstr "" - -#. MENU_STATUSLINE_ALIGN_RIGHT -#: po/tmp/ap_String_Id.h.h:1983 -msgid "Right-align the paragraph" -msgstr "" - -#. DLG_Para_DomDirection -#: po/tmp/ap_String_Id.h.h:1985 -msgid "Right-to-left &dominant" -msgstr "" - -#. FIELD_Document_Rights -#: po/tmp/ap_String_Id.h.h:1987 -msgid "Rights" -msgstr "" - -#. DLG_MetaData_Rights_LBL -#: po/tmp/ap_String_Id.h.h:1989 -msgid "Rights:" -msgstr "" - -#. DLG_FormatTable_Apply_To_Row -#: po/tmp/ap_String_Id.h.h:1991 -msgid "Row" -msgstr "" - -#. MENU_LABEL_TABLE_INSERT_ROWS_BEFORE -#: po/tmp/ap_String_Id.h.h:1993 -msgid "Rows &Above" -msgstr "" - -#. MENU_LABEL_TABLE_INSERT_ROWS_AFTER -#: po/tmp/ap_String_Id.h.h:1995 -msgid "Rows &Below" -msgstr "" - -#. MENU_LABEL_TOOLS_SCRIPTS -#: po/tmp/ap_String_Id.h.h:1997 -msgid "S&cripts" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_SHOW -#: po/tmp/ap_String_Id.h.h:1999 -msgid "S&how revisions" -msgstr "" - -#. MENU_LABEL_TABLE_SPLIT_CELLS -#: po/tmp/ap_String_Id.h.h:2001 -msgid "S&plit Cells" -msgstr "" - -#. DLG_Options_Btn_Save -#: po/tmp/ap_String_Id.h.h:2003 -msgid "Sa&ve" -msgstr "" - -#. MENU_LABEL_FILE_EXPORT -#: po/tmp/ap_String_Id.h.h:2005 -msgid "Sav&e Copy" -msgstr "" - -#. TOOLBAR_LABEL_FILE_SAVE -#: po/tmp/ap_String_Id.h.h:2007 -msgid "Save" -msgstr "" - -#. MENU_LABEL_FILE_SAVEAS -#: po/tmp/ap_String_Id.h.h:2009 -msgid "Save &As" -msgstr "" - -#. MENU_LABEL_FILE_SAVE_TEMPLATE -#: po/tmp/ap_String_Id.h.h:2011 -msgid "Save &Template" -msgstr "" - -#. TOOLBAR_LABEL_FILE_SAVEAS -#: po/tmp/ap_String_Id.h.h:2013 -msgid "Save As" -msgstr "" - -#. MENU_STATUSLINE_EDIT_COPYIMAGE -#: po/tmp/ap_String_Id.h.h:2015 -msgid "Save a copy of the image on the clipboard" -msgstr "" - -#. MSG_ConfirmSave -#: po/tmp/ap_String_Id.h.h:2017 -#, c-format -msgid "Save changes to document %s before closing?" -msgstr "" - -#. MENU_STATUSLINE_FILE_SAVEEMBED -#: po/tmp/ap_String_Id.h.h:2019 -msgid "Save the Embedded Object" -msgstr "" - -#. MENU_STATUSLINE_FILE_SAVE -#. TOOLBAR_STATUSLINE_FILE_SAVE -#. TOOLBAR_TOOLTIP_FILE_SAVE -#: po/tmp/ap_String_Id.h.h:2023 -msgid "Save the document" -msgstr "" - -#. MENU_STATUSLINE_FILE_SAVE_TEMPLATE -#: po/tmp/ap_String_Id.h.h:2025 -msgid "Save the document as a template" -msgstr "" - -#. MENU_STATUSLINE_FILE_SAVEAS -#. TOOLBAR_STATUSLINE_FILE_SAVEAS -#. TOOLBAR_TOOLTIP_FILE_SAVEAS -#: po/tmp/ap_String_Id.h.h:2029 -msgid "Save the document under a different name" -msgstr "" - -#. MENU_STATUSLINE_FILE_EXPORT -#: po/tmp/ap_String_Id.h.h:2031 -msgid "Save the document without changing the current name" -msgstr "" - -#. MENU_STATUSLINE_FILE_SAVEIMAGE -#: po/tmp/ap_String_Id.h.h:2033 -msgid "Save the selected image to a file" -msgstr "" - -#. MENU_LABEL_FILE_SAVEEMBED -#: po/tmp/ap_String_Id.h.h:2035 -msgid "Save to file" -msgstr "" - -#. DLG_PageSetup_Scale -#: po/tmp/ap_String_Id.h.h:2037 -msgid "Scale..." -msgstr "" - -#. MENU_STATUSLINE_HELP_SEARCH -#: po/tmp/ap_String_Id.h.h:2039 -msgid "Search for help about..." -msgstr "" - -#. DLG_WordCount_Update_Rate -#: po/tmp/ap_String_Id.h.h:2041 -msgid "Seconds between updates" -msgstr "" - -#. FIELD_DateTime_Epoch -#: po/tmp/ap_String_Id.h.h:2043 -msgid "Seconds since the epoch" -msgstr "" - -#. DLG_Break_SectionBreaks_Capital -#: po/tmp/ap_String_Id.h.h:2045 -msgid "Section Breaks" -msgstr "" - -#. DLG_Break_SectionBreaks -#: po/tmp/ap_String_Id.h.h:2047 -msgid "Section breaks" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_HISTORY -#: po/tmp/ap_String_Id.h.h:2049 -msgid "See history of the current document" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SELECT -#. DLG_Select -#: po/tmp/ap_String_Id.h.h:2051 po/tmp/xap_String_Id.h.h:667 -msgid "Select" -msgstr "" - -#. MENU_LABEL_EDIT_SELECTALL -#: po/tmp/ap_String_Id.h.h:2053 -msgid "Select A&ll" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SELECT_CELL -#: po/tmp/ap_String_Id.h.h:2055 -msgid "Select Cell" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SELECT_COLUMN -#: po/tmp/ap_String_Id.h.h:2057 -msgid "Select Column" -msgstr "" - -#. TOOLBAR_TOOLTIP_FMT_CHOOSE -#: po/tmp/ap_String_Id.h.h:2059 -msgid "Select Font" -msgstr "" - -#. DLG_ListRevisions_Title -#: po/tmp/ap_String_Id.h.h:2061 -msgid "Select Revision" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SELECT_ROW -#: po/tmp/ap_String_Id.h.h:2063 -msgid "Select Row" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SELECT_TABLE -#: po/tmp/ap_String_Id.h.h:2065 -msgid "Select Table" -msgstr "" - -#. MENU_LABEL_EDIT_SELECT_FRAME -#: po/tmp/ap_String_Id.h.h:2067 -msgid "Select Text Box" -msgstr "" - -#. DLG_InsertHyperlink_Msg -#: po/tmp/ap_String_Id.h.h:2069 -msgid "Select a target bookmark from the list." -msgstr "" - -#. DLG_FormatFrame_SelectImage -#. DLG_FormatTable_SelectImage -#: po/tmp/ap_String_Id.h.h:2072 -msgid "Select image from File" -msgstr "" - -#. MENU_STATUSLINE_EDIT_SELECT_FRAME -#: po/tmp/ap_String_Id.h.h:2074 -msgid "Select the Text Box" -msgstr "" - -#. MENU_STATUSLINE_EDIT_SELECTALL -#: po/tmp/ap_String_Id.h.h:2076 -msgid "Select the entire document" -msgstr "" - -#. DLG_FormatTable_Apply_To_Selection -#. DLG_UP_Selection -#: po/tmp/ap_String_Id.h.h:2078 po/tmp/xap_String_Id.h.h:675 -msgid "Selection" -msgstr "" - -#. DLG_ToggleCase_SentenceCase -#: po/tmp/ap_String_Id.h.h:2080 -msgid "Sentence case" -msgstr "" - -#. MENU_STATUSLINE_TABLE_TABLETOTEXTCOMMAS -#: po/tmp/ap_String_Id.h.h:2082 -msgid "Separate table items with commas" -msgstr "" - -#. MENU_STATUSLINE_TABLE_TABLETOTEXTCOMMASTABS -#: po/tmp/ap_String_Id.h.h:2084 -msgid "Separate table items with commas and tabs" -msgstr "" - -#. MENU_STATUSLINE_TABLE_TABLETOTEXTTABS -#: po/tmp/ap_String_Id.h.h:2086 -msgid "Separate table items with tabs" -msgstr "" - -#. MENU_LABEL_TABLE_TABLETOTEXTCOMMAS -#: po/tmp/ap_String_Id.h.h:2088 -msgid "Separate with commas" -msgstr "" - -#. MENU_LABEL_TABLE_TABLETOTEXTCOMMASTABS -#: po/tmp/ap_String_Id.h.h:2090 -msgid "Separate with commas and tabs" -msgstr "" - -#. MENU_LABEL_TABLE_TABLETOTEXTTABS -#: po/tmp/ap_String_Id.h.h:2092 -msgid "Separate with tabs" -msgstr "" - -#. DLG_Tab_Button_Set -#: po/tmp/ap_String_Id.h.h:2094 -msgid "Set" -msgstr "" - -#. MENU_LABEL_FMT_LANGUAGE -#: po/tmp/ap_String_Id.h.h:2096 -msgid "Set &Language" -msgstr "" - -#. DLG_Lists_SetDefault -#: po/tmp/ap_String_Id.h.h:2098 -msgid "Set Default Values" -msgstr "" - -#. DLG_FormatFrame_SetImage -#. DLG_FormatTable_SetImage -#: po/tmp/ap_String_Id.h.h:2101 -msgid "Set Image" -msgstr "" - -#. MENU_LABEL_FMT_SETPOSIMAGE -#: po/tmp/ap_String_Id.h.h:2103 -msgid "Set Positioned Image" -msgstr "" - -#. DLG_FormatFrame_SetTextWrapping -#: po/tmp/ap_String_Id.h.h:2105 -msgid "Set Text Wrapping" -msgstr "" - -#. MENU_STATUSLINE_FMT_BACKGROUND_PAGE_IMAGE -#: po/tmp/ap_String_Id.h.h:2107 -msgid "Set an image as a background for your page" -msgstr "" - -#. MENU_STATUSLINE_FMT_DIRECTION_DOCD_RTL -#: po/tmp/ap_String_Id.h.h:2109 -msgid "Set dominant direction of document to RTL" -msgstr "" - -#. MENU_STATUSLINE_FMT_DIRECTION_DD_RTL -#: po/tmp/ap_String_Id.h.h:2111 -msgid "Set dominant direction of paragraph to RTL" -msgstr "" - -#. MENU_STATUSLINE_FMT_DIRECTION_SD_RTL -#: po/tmp/ap_String_Id.h.h:2113 -msgid "Set dominant direction of section to RTL" -msgstr "" - -#. MENU_STATUSLINE_FILE_PROPERTIES -#: po/tmp/ap_String_Id.h.h:2115 -msgid "Set meta-data properties" -msgstr "" - -#. DLG_Tab_Label_New -#: po/tmp/ap_String_Id.h.h:2117 -msgid "Set new Tab" -msgstr "" - -#. DLG_FormatFrame_NoImageBackground -#. DLG_FormatTable_NoImageBackground -#: po/tmp/ap_String_Id.h.h:2120 -msgid "Set no image" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_OPTIONS -#: po/tmp/ap_String_Id.h.h:2122 -msgid "Set preferences" -msgstr "" - -#. MENU_STATUSLINE_FMT_TABS -#: po/tmp/ap_String_Id.h.h:2124 -msgid "Set tab stops" -msgstr "" - -#. MENU_STATUSLINE_FMT_TABLEOFCONTENTS -#: po/tmp/ap_String_Id.h.h:2126 -msgid "Set the type and styles of the Table of Contents" -msgstr "" - -#. MENU_STATUSLINE_FMT_FOOTNOTES -#: po/tmp/ap_String_Id.h.h:2128 -msgid "Set the types of Footnotes and Endnotes" -msgstr "" - -#. MENU_STATUSLINE_FMT_HDRFTR -#: po/tmp/ap_String_Id.h.h:2130 -msgid "Set the types of Headers and Footers" -msgstr "" - -#. MENU_LABEL_TABLE_HEADING_ROWS_REPEAT_THIS -#: po/tmp/ap_String_Id.h.h:2132 -msgid "Set this Row as Heading" -msgstr "" - -#. MENU_STATUSLINE_TABLE_HEADING_ROWS_REPEAT_THIS -#: po/tmp/ap_String_Id.h.h:2134 -msgid "Set this Row as the Heading on each page" -msgstr "" - -#. MENU_STATUSLINE_FMT_SETPOSIMAGE -#: po/tmp/ap_String_Id.h.h:2136 -msgid "Set this image to be positioned" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_SPELLPREFS -#: po/tmp/ap_String_Id.h.h:2138 -msgid "Set your spelling preferences" -msgstr "" - -#. MENU_STATUSLINE_FMT_DOCUMENT -#: po/tmp/ap_String_Id.h.h:2140 -msgid "Setup your document's page properties such as page size and margins" -msgstr "" - -#. DLG_Styles_ModifyShortCut -#: po/tmp/ap_String_Id.h.h:2142 -msgid "Shortcut Key" -msgstr "" - -#. DLG_Options_Label_Show -#. DLG_Show -#: po/tmp/ap_String_Id.h.h:2144 po/tmp/xap_String_Id.h.h:687 -msgid "Show" -msgstr "" - -#. MENU_LABEL_VIEW_RULER -#: po/tmp/ap_String_Id.h.h:2146 -msgid "Show &Ruler" -msgstr "" - -#. TOOLBAR_LABEL_VIEW_SHOWPARA -#: po/tmp/ap_String_Id.h.h:2148 -msgid "Show All" -msgstr "" - -#. MENU_LABEL_VIEW_SHOWPARA -#: po/tmp/ap_String_Id.h.h:2150 -msgid "Show For&matting Marks" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_SHOW_BEFORE -#: po/tmp/ap_String_Id.h.h:2152 -msgid "Show document &before revisions" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_SHOW_AFTER -#: po/tmp/ap_String_Id.h.h:2154 -msgid "Show document a&fter revisions" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_SHOW_AFTERPREV -#: po/tmp/ap_String_Id.h.h:2156 -msgid "Show document after &previous revisions" -msgstr "" - -#. MENU_STATUSLINE_WINDOW_MORE -#: po/tmp/ap_String_Id.h.h:2158 -msgid "Show full list of documents" -msgstr "" - -#. MENU_STATUSLINE_VIEW_RULER -#: po/tmp/ap_String_Id.h.h:2160 -msgid "Show or hide the rulers" -msgstr "" - -#. MENU_STATUSLINE_VIEW_STATUSBAR -#: po/tmp/ap_String_Id.h.h:2162 -msgid "Show or hide the status bar" -msgstr "" - -#. MENU_STATUSLINE_VIEW_TB_1 -#. MENU_STATUSLINE_VIEW_TB_2 -#. MENU_STATUSLINE_VIEW_TB_3 -#. MENU_STATUSLINE_VIEW_TB_4 -#: po/tmp/ap_String_Id.h.h:2167 -msgid "Show or hide the toolbar" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_SHOW -#: po/tmp/ap_String_Id.h.h:2169 -msgid "Show revisions that are present in document" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_SHOW_AFTERPREV -#: po/tmp/ap_String_Id.h.h:2171 -msgid "Show what the document looks like after previous revisions" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_SHOW_AFTER -#: po/tmp/ap_String_Id.h.h:2173 -msgid "Show what the document looks like after revisions" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_SHOW_BEFORE -#: po/tmp/ap_String_Id.h.h:2175 -msgid "Show what the document looks like before revisions" -msgstr "" - -#. DLG_Options_Label_ViewShowHide -#: po/tmp/ap_String_Id.h.h:2177 -msgid "Show..." -msgstr "" - -#. TOOLBAR_STATUSLINE_VIEW_SHOWPARA -#. TOOLBAR_TOOLTIP_VIEW_SHOWPARA -#: po/tmp/ap_String_Id.h.h:2180 -msgid "Show/hide formatting marks" -msgstr "" - -#. TB_Simple -#: po/tmp/ap_String_Id.h.h:2182 -msgid "Simple" -msgstr "" - -#. DLG_Options_Label_ViewSimpleTB -#: po/tmp/ap_String_Id.h.h:2184 -msgid "Simple Toolbar" -msgstr "" - -#. DLG_Para_SpacingSingle -#: po/tmp/ap_String_Id.h.h:2186 -msgid "Single" -msgstr "" - -#. TOOLBAR_LABEL_SINGLE_SPACE -#: po/tmp/ap_String_Id.h.h:2188 -msgid "Single Spacing" -msgstr "" - -#. TOOLBAR_STATUSLINE_SINGLE_SPACE -#. TOOLBAR_TOOLTIP_SINGLE_SPACE -#: po/tmp/ap_String_Id.h.h:2191 -msgid "Single spacing" -msgstr "" - -#. MENU_LABEL_TABLE_SORT -#: po/tmp/ap_String_Id.h.h:2193 -msgid "So&rt Table" -msgstr "" - -#. MENU_LABEL_TABLE_SORTCOLSASCEND -#: po/tmp/ap_String_Id.h.h:2195 -msgid "Sort Columns in Ascending Order" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SORTCOLSASCEND -#: po/tmp/ap_String_Id.h.h:2197 -msgid "Sort Columns in Ascending Order based on Selected Row" -msgstr "" - -#. MENU_LABEL_TABLE_SORTCOLSDESCEND -#: po/tmp/ap_String_Id.h.h:2199 -msgid "Sort Columns in Descending Order" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SORTCOLSDESCEND -#: po/tmp/ap_String_Id.h.h:2201 -msgid "Sort Columns in Descending Order based on Selected Row" -msgstr "" - -#. MENU_LABEL_TABLE_SORTROWSASCEND -#: po/tmp/ap_String_Id.h.h:2203 -msgid "Sort Rows in Ascending Order" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SORTROWSASCEND -#: po/tmp/ap_String_Id.h.h:2205 -msgid "Sort Rows in Ascending Order based on selected Column" -msgstr "" - -#. MENU_LABEL_TABLE_SORTROWSDESCEND -#: po/tmp/ap_String_Id.h.h:2207 -msgid "Sort Rows in Descending Order" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SORTROWSDESCEND -#: po/tmp/ap_String_Id.h.h:2209 -msgid "Sort Rows in Descending Order based on Selected Column" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SORT -#: po/tmp/ap_String_Id.h.h:2211 -msgid "Sort Table" -msgstr "" - -#. DLG_MetaData_Source_LBL -#: po/tmp/ap_String_Id.h.h:2213 -msgid "Source:" -msgstr "" - -#. DLG_Column_Space_After -#: po/tmp/ap_String_Id.h.h:2215 -msgid "Space after Column" -msgstr "" - -#. TOOLBAR_STATUSLINE_PARA_12BEFORE -#. TOOLBAR_TOOLTIP_PARA_12BEFORE -#: po/tmp/ap_String_Id.h.h:2218 -msgid "Space before: 12 pt" -msgstr "" - -#. TOOLBAR_STATUSLINE_PARA_0BEFORE -#. TOOLBAR_TOOLTIP_PARA_0BEFORE -#: po/tmp/ap_String_Id.h.h:2221 -msgid "Space before: None" -msgstr "" - -#. DLG_Para_LabelSpacing -#: po/tmp/ap_String_Id.h.h:2223 -msgid "Spacing" -msgstr "" - -#. DLG_Options_SpellCheckingTitle -#: po/tmp/ap_String_Id.h.h:2225 -msgid "Spell Checking" -msgstr "" - -#. TOOLBAR_LABEL_SPELLCHECK -#: po/tmp/ap_String_Id.h.h:2227 -msgid "Spellcheck" -msgstr "" - -#. TOOLBAR_STATUSLINE_SPELLCHECK -#. TOOLBAR_TOOLTIP_SPELLCHECK -#: po/tmp/ap_String_Id.h.h:2230 -msgid "Spellcheck the document" -msgstr "" - -#. DLG_Spell_SpellTitle -#. DLG_Options_TabLabel_Spelling -#: po/tmp/ap_String_Id.h.h:2233 -msgid "Spelling" -msgstr "" - -#. MENU_LABEL_TOOLS_SPELLPREFS -#: po/tmp/ap_String_Id.h.h:2235 -msgid "Spelling &Options" -msgstr "" - -#. MENU_LABEL_TABLE_SPLIT_TABLE -#: po/tmp/ap_String_Id.h.h:2237 -msgid "Spli&t Table" -msgstr "" - -#. DLG_SplitCellsTitle -#. DLG_SplitCells_Frame -#. MENU_STATUSLINE_TABLE_SPLIT_CELLS -#: po/tmp/ap_String_Id.h.h:2241 -msgid "Split Cells" -msgstr "" - -#. MENU_STATUSLINE_TABLE_SPLIT_TABLE -#: po/tmp/ap_String_Id.h.h:2243 -msgid "Split Table" -msgstr "" - -#. TOOLBAR_LABEL_SPLIT_CELLS -#: po/tmp/ap_String_Id.h.h:2245 -msgid "Split cells" -msgstr "" - -#. DLG_SplitCells_HoriMid -#. DLG_SplitCells_VertMid -#: po/tmp/ap_String_Id.h.h:2248 -msgid "Split in Middle" -msgstr "" - -#. DLG_SplitCells_Below -#: po/tmp/ap_String_Id.h.h:2250 -msgid "Split on Bottom Side" -msgstr "" - -#. DLG_SplitCells_Left -#: po/tmp/ap_String_Id.h.h:2252 -msgid "Split on Left Side" -msgstr "" - -#. DLG_SplitCells_Right -#: po/tmp/ap_String_Id.h.h:2254 -msgid "Split on Right Side" -msgstr "" - -#. DLG_SplitCells_Above -#: po/tmp/ap_String_Id.h.h:2256 -msgid "Split on Top Side" -msgstr "" - -#. MENU_STATUSLINE_TABLE_TEXTTOTABLE_NOSPACES -#: po/tmp/ap_String_Id.h.h:2258 -msgid "Split on all delimiters except spaces" -msgstr "" - -#. MENU_STATUSLINE_TABLE_TEXTTOTABLE_ALL -#: po/tmp/ap_String_Id.h.h:2260 -msgid "Split on all word delimiters including spaces" -msgstr "" - -#. MENU_LABEL_TABLE_TEXTTOTABLE_NOSPACES -#: po/tmp/ap_String_Id.h.h:2262 -msgid "Split text at commas or tabs" -msgstr "" - -#. MENU_LABEL_TABLE_TEXTTOTABLE_ALL -#: po/tmp/ap_String_Id.h.h:2264 -msgid "Split text at spaces, commas, or tabs" -msgstr "" - -#. TOOLBAR_STATUSLINE_SPLIT_CELLS -#. TOOLBAR_TOOLTIP_SPLIT_CELLS -#: po/tmp/ap_String_Id.h.h:2267 -msgid "Split this cell" -msgstr "" - -#. DLG_Lists_Square_List -#. STYLE_SQUARELIST -#: po/tmp/ap_String_Id.h.h:2269 po/tmp/xap_String_Id.h.h:699 -msgid "Square List" -msgstr "" - -#. MENU_LABEL_FMT_STYLE -#: po/tmp/ap_String_Id.h.h:2271 -msgid "St&yle" -msgstr "" - -#. TB_Standard -#: po/tmp/ap_String_Id.h.h:2273 -msgid "Standard" -msgstr "" - -#. DLG_Options_Label_ViewStandardTB -#: po/tmp/ap_String_Id.h.h:2275 -msgid "Standard Toolbar" -msgstr "" - -#. DLG_Lists_Star_List -#. STYLE_STARLIST -#: po/tmp/ap_String_Id.h.h:2277 po/tmp/xap_String_Id.h.h:703 -msgid "Star List" -msgstr "" - -#. DLG_Lists_Start -#: po/tmp/ap_String_Id.h.h:2279 -msgid "Start At:" -msgstr "" - -#. DLG_Lists_Start_New_List -#. DLG_Lists_Start_New -#: po/tmp/ap_String_Id.h.h:2282 -msgid "Start New List" -msgstr "" - -#. DLG_Lists_Start_Sub -#: po/tmp/ap_String_Id.h.h:2284 -msgid "Start Sublist" -msgstr "" - -#. DLG_MarkRevisions_Check2Label -#: po/tmp/ap_String_Id.h.h:2286 -msgid "Start a new revision" -msgstr "" - -#. MENU_LABEL_TOOLS_REVISIONS_NEW_REVISION -#: po/tmp/ap_String_Id.h.h:2288 -msgid "Start ne&w revision" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_REVISIONS_NEW_REVISION -#: po/tmp/ap_String_Id.h.h:2290 -msgid "Start revision distinct from the current one" -msgstr "" - -#. DLG_WordCount_Statistics -#: po/tmp/ap_String_Id.h.h:2292 -msgid "Statistics:" -msgstr "" - -#. DLG_Lists_Stop_Current_List -#: po/tmp/ap_String_Id.h.h:2294 -msgid "Stop Current List" -msgstr "" - -#. MENU_LABEL_FMT_STRIKE -#: po/tmp/ap_String_Id.h.h:2296 -msgid "Stri&ke" -msgstr "" - -#. TOOLBAR_LABEL_FMT_STRIKE -#. TOOLBAR_STATUSLINE_FMT_STRIKE -#. TOOLBAR_TOOLTIP_FMT_STRIKE -#. DLG_UFS_StrikeoutCheck -#: po/tmp/ap_String_Id.h.h:2300 po/tmp/xap_String_Id.h.h:705 -msgid "Strike" -msgstr "" - -#. MENU_STATUSLINE_FMT_STRIKE -#: po/tmp/ap_String_Id.h.h:2302 -msgid "Strikeout the selection (toggle)" -msgstr "" - -#. MENU_LABEL_FMT_STYLIST -#: po/tmp/ap_String_Id.h.h:2304 -msgid "Sty&list" -msgstr "" - -#. TOOLBAR_LABEL_FMT_STYLE -#. TOOLBAR_STATUSLINE_FMT_STYLE -#. TOOLBAR_TOOLTIP_FMT_STYLE -#: po/tmp/ap_String_Id.h.h:2308 -msgid "Style" -msgstr "" - -#. DLG_Styles_ErrNotTitle1 -#: po/tmp/ap_String_Id.h.h:2310 -msgid "Style Name - " -msgstr "" - -#. DLG_Styles_ModifyName -#: po/tmp/ap_String_Id.h.h:2312 -msgid "Style Name:" -msgstr "" - -#. DLG_Styles_ModifyType -#: po/tmp/ap_String_Id.h.h:2314 -msgid "Style Type" -msgstr "" - -#. DLG_Styles_ModifyFollowing -#: po/tmp/ap_String_Id.h.h:2316 -msgid "Style for following paragraph" -msgstr "" - -#. DLG_Styles_ErrBlankName -#: po/tmp/ap_String_Id.h.h:2318 -msgid "Style name cannot be left blank" -msgstr "" - -#. DLG_Lists_Style -#. DLG_UFS_StyleLabel -#: po/tmp/ap_String_Id.h.h:2320 po/tmp/xap_String_Id.h.h:707 -msgid "Style:" -msgstr "" - -#. DLG_Styles_StylesTitle -#. DLG_Stylist_Styles -#: po/tmp/ap_String_Id.h.h:2323 -msgid "Styles" -msgstr "" - -#. DLG_Stylist_Title -#: po/tmp/ap_String_Id.h.h:2325 -msgid "Stylist" -msgstr "" - -#. FIELD_Document_Subject -#: po/tmp/ap_String_Id.h.h:2327 -msgid "Subject" -msgstr "" - -#. DLG_MetaData_Subject_LBL -#: po/tmp/ap_String_Id.h.h:2329 -msgid "Subject:" -msgstr "" - -#. TOOLBAR_LABEL_FMT_SUBSCRIPT -#. TOOLBAR_STATUSLINE_FMT_SUBSCRIPT -#. TOOLBAR_TOOLTIP_FMT_SUBSCRIPT -#. DLG_UFS_SubScript -#: po/tmp/ap_String_Id.h.h:2333 po/tmp/xap_String_Id.h.h:711 -msgid "Subscript" -msgstr "" - -#. DLG_Spell_Suggestions -#: po/tmp/ap_String_Id.h.h:2335 -msgid "Sugg&estions:" -msgstr "" - -#. DLG_Options_Label_SpellMainOnly -#: po/tmp/ap_String_Id.h.h:2337 -msgid "Suggest from &main dictionary only" -msgstr "" - -#. MENU_LABEL_TABLE_INSERT_SUMROWS -#: po/tmp/ap_String_Id.h.h:2339 -msgid "Sum a Column" -msgstr "" - -#. MENU_LABEL_TABLE_INSERT_SUMCOLS -#: po/tmp/ap_String_Id.h.h:2341 -msgid "Sum a Row" -msgstr "" - -#. FIELD_Numbers_TableSumRows -#: po/tmp/ap_String_Id.h.h:2343 -msgid "Sum a Table Column" -msgstr "" - -#. FIELD_Numbers_TableSumCols -#: po/tmp/ap_String_Id.h.h:2345 -msgid "Sum a Table Row" -msgstr "" - -#. DLG_MetaData_TAB_Summary -#: po/tmp/ap_String_Id.h.h:2347 -msgid "Summary" -msgstr "" - -#. MENU_LABEL_FMT_SUPERSCRIPT -#: po/tmp/ap_String_Id.h.h:2349 -msgid "Supe&rscript" -msgstr "" - -#. TOOLBAR_LABEL_FMT_SUPERSCRIPT -#. TOOLBAR_STATUSLINE_FMT_SUPERSCRIPT -#. TOOLBAR_TOOLTIP_FMT_SUPERSCRIPT -#. DLG_UFS_SuperScript -#: po/tmp/ap_String_Id.h.h:2353 po/tmp/xap_String_Id.h.h:713 -msgid "Superscript" -msgstr "" - -#. MENU_LABEL_INSERT_SYMBOL -#: po/tmp/ap_String_Id.h.h:2355 -msgid "Sy&mbol" -msgstr "" - -#. TOOLBAR_LABEL_INSERT_SYMBOL -#: po/tmp/ap_String_Id.h.h:2357 -msgid "Symbol" -msgstr "" - -#. MENU_LABEL_TABLE -#: po/tmp/ap_String_Id.h.h:2359 -msgid "T&able" -msgstr "" - -#. TabStopStatus -#: po/tmp/ap_String_Id.h.h:2361 -#, c-format -msgid "Tab Stop [%s]" -msgstr "" - -#. DLG_Tab_Label_TabPosition -#: po/tmp/ap_String_Id.h.h:2363 -msgid "Tab stop position:" -msgstr "" - -#. DLG_Tab_Label_TabToClear -#: po/tmp/ap_String_Id.h.h:2365 -msgid "Tab stops to be cleared:" -msgstr "" - -#. DLG_FormatTable_Apply_To_Table -#. MENU_STATUSLINE_TABLE -#. TB_Table -#: po/tmp/ap_String_Id.h.h:2369 po/tmp/xap_String_Id.h.h:723 -msgid "Table" -msgstr "" - -#. DLG_InsertTable_TableSize_Capital -#: po/tmp/ap_String_Id.h.h:2371 -msgid "Table Size" -msgstr "" - -#. DLG_Options_Label_ViewTableTB -#: po/tmp/ap_String_Id.h.h:2373 -msgid "Table Toolbar" -msgstr "" - -#. MENU_LABEL_INSERT_TABLEOFCONTENTS -#. MENU_LABEL_FMT_TABLEOFCONTENTS -#: po/tmp/ap_String_Id.h.h:2376 -msgid "Table of Contents" -msgstr "" - -#. FIELD_Numbers_TOCListLabel -#: po/tmp/ap_String_Id.h.h:2378 -msgid "Table of Contents List Label" -msgstr "" - -#. FIELD_Numbers_TOCPageNumber -#: po/tmp/ap_String_Id.h.h:2380 -msgid "Table of Contents Page" -msgstr "" - -#. DLG_InsertTable_TableSize -#: po/tmp/ap_String_Id.h.h:2382 -msgid "Table size" -msgstr "" - -#. DLG_Styles_ModifyTabs -#. DLG_Tab_TabTitle -#: po/tmp/ap_String_Id.h.h:2385 -msgid "Tabs" -msgstr "" - -#. DLG_FormatTOC_DetailsTabPage -#: po/tmp/ap_String_Id.h.h:2387 -msgid "Tabs and Page Numbering" -msgstr "" - -#. MENU_LABEL_FMT -#: po/tmp/ap_String_Id.h.h:2389 -msgid "Te&xt Formatting" -msgstr "" - -#. DLG_Options_Label_Text -#: po/tmp/ap_String_Id.h.h:2391 -msgid "Text" -msgstr "" - -#. DLG_FormatTOC_TextAfter -#: po/tmp/ap_String_Id.h.h:2393 -msgid "Text &after:" -msgstr "" - -#. DLG_FormatTOC_TextBefore -#: po/tmp/ap_String_Id.h.h:2395 -msgid "Text &before:" -msgstr "" - -#. DLG_Lists_Align -#: po/tmp/ap_String_Id.h.h:2397 -msgid "Text Align:" -msgstr "" - -#. MENU_LABEL_INSERT_TEXTBOX -#. MENU_LABEL_FMT_FRAME -#: po/tmp/ap_String_Id.h.h:2400 -msgid "Text Box" -msgstr "" - -#. DLG_Lists_PageFolding -#: po/tmp/ap_String_Id.h.h:2402 -msgid "Text Folding" -msgstr "" - -#. DLG_FormatFrame_TextWrapping -#: po/tmp/ap_String_Id.h.h:2404 -msgid "Text Wrapping" -msgstr "" - -#. DLG_Options_Label_Both -#: po/tmp/ap_String_Id.h.h:2406 -msgid "Text and Icon" -msgstr "" - -#. DLG_PageSetup_ErrBigMargins -#: po/tmp/ap_String_Id.h.h:2408 -msgid "The margins selected are too large to fit on the page." -msgstr "" - -#. DLG_Options_Prompt_YouMustRestart -#: po/tmp/ap_String_Id.h.h:2410 -msgid "" -"The new user interface language will take effect the next time that you " -"start the application" -msgstr "" - -#. MSG_SpellDone -#: po/tmp/ap_String_Id.h.h:2412 -msgid "The spelling check is complete." -msgstr "" - -#. MSG_HyperlinkCrossesBoundaries -#: po/tmp/ap_String_Id.h.h:2414 -msgid "" -"The text to which the hyperlink is to be attached must be within a single " -"paragraph." -msgstr "" - -#. FIELD_DateTime_Wkday -#: po/tmp/ap_String_Id.h.h:2416 -msgid "The weekday" -msgstr "" - -#. DLG_FormatTable_Thickness -#: po/tmp/ap_String_Id.h.h:2418 -msgid "Thickness:" -msgstr "" - -#. MSG_AfterRestartNew -#: po/tmp/ap_String_Id.h.h:2420 -msgid "" -"This change will only take effect when you restart AbiWord or create a new " -"document." -msgstr "" - -#. MSG_HiddenRevisions -#: po/tmp/ap_String_Id.h.h:2422 -msgid "" -"This document contains revisions which are currently hidden from view. " -"Please see AbiWord documentation for information on working with revisions." -msgstr "" - -#. DLG_Para_PreviewSampleFallback -#: po/tmp/ap_String_Id.h.h:2424 -msgid "" -"This paragraph represents words as they might appear in your document. To " -"see text from your document used in this preview, position your cursor in a " -"document paragraph with some text in it and open this dialog." -msgstr "" - -#. DLG_Styles_ErrStyleNot -#: po/tmp/ap_String_Id.h.h:2426 -msgid "" -"This style does not exist \n" -" so it cannot be modified" -msgstr "" - -#. DLG_Column_Three -#: po/tmp/ap_String_Id.h.h:2428 -msgid "Three" -msgstr "" - -#. DLG_Lists_Tick_List -#. STYLE_TICKLIST -#: po/tmp/ap_String_Id.h.h:2430 po/tmp/xap_String_Id.h.h:757 -msgid "Tick List" -msgstr "" - -#. FIELD_DateTime_TimeZone -#: po/tmp/ap_String_Id.h.h:2432 -msgid "Time Zone" -msgstr "" - -#. FIELD_Document_Title -#: po/tmp/ap_String_Id.h.h:2434 -msgid "Title" -msgstr "" - -#. DLG_ToggleCase_TitleCase -#: po/tmp/ap_String_Id.h.h:2436 -msgid "Title Case" -msgstr "" - -#. DLG_MetaData_Title_LBL -#. DLG_Image_LblTitle -#: po/tmp/ap_String_Id.h.h:2438 po/tmp/xap_String_Id.h.h:761 -msgid "Title:" -msgstr "" - -#. DLG_Options_Label_Toolbars -#: po/tmp/ap_String_Id.h.h:2440 -msgid "Toolbars" -msgstr "" - -#. TopMarginStatus -#: po/tmp/ap_String_Id.h.h:2442 -#, c-format -msgid "Top Margin [%s]" -msgstr "" - -#. MENU_LABEL_FMT_TOPLINE -#. TOOLBAR_LABEL_FMT_TOPLINE -#. TOOLBAR_STATUSLINE_FMT_TOPLINE -#. TOOLBAR_TOOLTIP_FMT_TOPLINE -#. DLG_UFS_ToplineCheck -#: po/tmp/ap_String_Id.h.h:2447 po/tmp/xap_String_Id.h.h:767 -msgid "Topline" -msgstr "" - -#. DLG_Lists_Triangle_List -#. STYLE_TRIANGLELIST -#: po/tmp/ap_String_Id.h.h:2449 po/tmp/xap_String_Id.h.h:769 -msgid "Triangle List" -msgstr "" - -#. DLG_Column_Two -#: po/tmp/ap_String_Id.h.h:2451 -msgid "Two" -msgstr "" - -#. FIELD_Document_Type -#: po/tmp/ap_String_Id.h.h:2453 -msgid "Type" -msgstr "" - -#. DLG_InsertBookmark_Msg -#: po/tmp/ap_String_Id.h.h:2455 -msgid "Type a name for the bookmark, or select an existing from the list." -msgstr "" - -#. DLG_Lists_Type -#: po/tmp/ap_String_Id.h.h:2457 -msgid "Type:" -msgstr "" - -#. DLG_ToggleCase_UpperCase -#: po/tmp/ap_String_Id.h.h:2459 -msgid "UPPERCASE" -msgstr "" - -#. TOOLBAR_LABEL_FMT_UNDERLINE -#. TOOLBAR_STATUSLINE_FMT_UNDERLINE -#. TOOLBAR_TOOLTIP_FMT_UNDERLINE -#. DLG_UFS_UnderlineCheck -#: po/tmp/ap_String_Id.h.h:2463 po/tmp/xap_String_Id.h.h:789 -msgid "Underline" -msgstr "" - -#. MENU_STATUSLINE_FMT_UNDERLINE -#: po/tmp/ap_String_Id.h.h:2465 -msgid "Underline the selection (toggle)" -msgstr "" - -#. TOOLBAR_LABEL_EDIT_UNDO -#: po/tmp/ap_String_Id.h.h:2467 -msgid "Undo" -msgstr "" - -#. MENU_STATUSLINE_EDIT_UNDO -#. TOOLBAR_STATUSLINE_EDIT_UNDO -#. TOOLBAR_TOOLTIP_EDIT_UNDO -#: po/tmp/ap_String_Id.h.h:2471 -msgid "Undo editing" -msgstr "" - -#. DLG_Lists_Upper_Case_List -#. STYLE_UPPERCASTELIST -#: po/tmp/ap_String_Id.h.h:2473 po/tmp/xap_String_Id.h.h:823 -msgid "Upper Case List" -msgstr "" - -#. DLG_Lists_Upper_Roman_List -#. STYLE_UPPERROMANLIST -#: po/tmp/ap_String_Id.h.h:2475 po/tmp/xap_String_Id.h.h:825 -msgid "Upper Roman List" -msgstr "" - -#. DLG_Column_RtlOrder -#: po/tmp/ap_String_Id.h.h:2477 -msgid "Use RTL Order" -msgstr "" - -#. DLG_Options_Label_HebrewContextGlyphs -#: po/tmp/ap_String_Id.h.h:2479 -msgid "Use glyph shaping for Hebrew" -msgstr "" - -#. DLG_Options_Label_UI -#: po/tmp/ap_String_Id.h.h:2481 -msgid "User Interface" -msgstr "" - -#. DLG_Options_Label_UILang -#: po/tmp/ap_String_Id.h.h:2483 -msgid "User Interface Language" -msgstr "" - -#. DLG_Stylist_UserStyles -#: po/tmp/ap_String_Id.h.h:2485 -msgid "User defined Styles" -msgstr "" - -#. DLG_Tab_Label_Existing -#: po/tmp/ap_String_Id.h.h:2487 -msgid "User-defined Tabs" -msgstr "" - -#. DLG_Styles_LBL_UserDefined -#: po/tmp/ap_String_Id.h.h:2489 -msgid "User-defined styles" -msgstr "" - -#. FIELD_Application_Version -#. DLG_History_Version_Version -#: po/tmp/ap_String_Id.h.h:2491 po/tmp/xap_String_Id.h.h:833 -msgid "Version" -msgstr "" - -#. DLG_Options_TabLabel_View -#: po/tmp/ap_String_Id.h.h:2493 -msgid "View" -msgstr "" - -#. MENU_STATUSLINE_TOOLS_HISTORY_SHOW -#: po/tmp/ap_String_Id.h.h:2495 -msgid "View document history" -msgstr "" - -#. MENU_STATUSLINE_VIEW_FULLSCREEN -#: po/tmp/ap_String_Id.h.h:2497 -msgid "View the document in full screen mode" -msgstr "" - -#. MENU_STATUSLINE_WINDOW_1 -#. MENU_STATUSLINE_WINDOW_2 -#. MENU_STATUSLINE_WINDOW_3 -#. MENU_STATUSLINE_WINDOW_4 -#. MENU_STATUSLINE_WINDOW_5 -#. MENU_STATUSLINE_WINDOW_6 -#. MENU_STATUSLINE_WINDOW_7 -#. MENU_STATUSLINE_WINDOW_8 -#. MENU_STATUSLINE_WINDOW_9 -#: po/tmp/ap_String_Id.h.h:2507 -msgid "View this document" -msgstr "" - -#. DLG_Options_Label_ViewTooltips -#: po/tmp/ap_String_Id.h.h:2509 -msgid "View tooltips" -msgstr "" - -#. DLG_Options_Label_ViewViewFrame -#: po/tmp/ap_String_Id.h.h:2511 -msgid "View..." -msgstr "" - -#. DLG_Options_Label_Visible -#: po/tmp/ap_String_Id.h.h:2513 -msgid "Visible" -msgstr "" - -#. MSG_HyperlinkNoBookmark -#: po/tmp/ap_String_Id.h.h:2515 -#, c-format -msgid "Warning: the bookmark you provided [%s] does not exist." -msgstr "" - -#. MENU_STATUSLINE_VIEW_WEB -#: po/tmp/ap_String_Id.h.h:2517 -msgid "Web Layout" -msgstr "" - -#. DLG_Styles_LBL_TxtMsg -#: po/tmp/ap_String_Id.h.h:2519 -msgid "What Hath God Wrought" -msgstr "" - -#. DLG_Options_Label_WithExtension -#: po/tmp/ap_String_Id.h.h:2521 -msgid "With extension:" -msgstr "" - -#. DLG_WordCount_WordCountTitle -#. FIELD_Numbers_WordCount -#: po/tmp/ap_String_Id.h.h:2524 -msgid "Word Count" -msgstr "" - -#. DLG_NEW_Tab1 -#: po/tmp/ap_String_Id.h.h:2526 -msgid "Wordprocessing" -msgstr "" - -#. DLG_WordCount_Words_No_Notes -#: po/tmp/ap_String_Id.h.h:2528 -msgid "Words (no footnotes/endnotes):" -msgstr "" - -#. DLG_Options_Label_SpellUppercase -#: po/tmp/ap_String_Id.h.h:2530 -msgid "Words in &UPPERCASE" -msgstr "" - -#. DLG_Options_Label_SpellNumbers -#: po/tmp/ap_String_Id.h.h:2532 -msgid "Words with num&bers" -msgstr "" - -#. DLG_WordCount_Words -#: po/tmp/ap_String_Id.h.h:2534 -msgid "Words:" -msgstr "" - -#. MSG_SaveFailedWrite -#: po/tmp/ap_String_Id.h.h:2536 -#, c-format -msgid "Writing error when attempting to save %s" -msgstr "" - -#. MSG_DefaultDirectionChg -#: po/tmp/ap_String_Id.h.h:2538 -msgid "You have changed the default direction." -msgstr "" - -#. MSG_DirectionModeChg -#: po/tmp/ap_String_Id.h.h:2540 -msgid "You have changed the direction mode." -msgstr "" - -#. MSG_HyperlinkNoSelection -#: po/tmp/ap_String_Id.h.h:2542 -msgid "You must select a portion of the document before inserting a hyperlink." -msgstr "" - -#. DLG_Options_Label_InvalidRangeForAutoSave -#: po/tmp/ap_String_Id.h.h:2544 -msgid "You should choose a range from 1 to 120 for the auto save frequency" -msgstr "" - -#. MSG_ConfirmSaveSecondary -#: po/tmp/ap_String_Id.h.h:2546 -msgid "Your changes will be lost if you don't save them." -msgstr "" - -#. TOOLBAR_LABEL_ZOOM -#. TOOLBAR_STATUSLINE_ZOOM -#. TOOLBAR_TOOLTIP_ZOOM -#. DLG_Zoom_ZoomTitle -#: po/tmp/ap_String_Id.h.h:2550 po/tmp/xap_String_Id.h.h:882 -msgid "Zoom" -msgstr "" - -#. MENU_LABEL_VIEW_ZOOM_100 -#: po/tmp/ap_String_Id.h.h:2552 -msgid "Zoom to &100%" -msgstr "" - -#. MENU_LABEL_VIEW_ZOOM_200 -#: po/tmp/ap_String_Id.h.h:2554 -msgid "Zoom to &200%" -msgstr "" - -#. MENU_LABEL_VIEW_ZOOM_50 -#: po/tmp/ap_String_Id.h.h:2556 -msgid "Zoom to &50%" -msgstr "" - -#. MENU_LABEL_VIEW_ZOOM_75 -#: po/tmp/ap_String_Id.h.h:2558 -msgid "Zoom to &75%" -msgstr "" - -#. MENU_STATUSLINE_VIEW_ZOOM_100 -#: po/tmp/ap_String_Id.h.h:2560 -msgid "Zoom to 100%" -msgstr "" - -#. MENU_STATUSLINE_VIEW_ZOOM_200 -#: po/tmp/ap_String_Id.h.h:2562 -msgid "Zoom to 200%" -msgstr "" - -#. MENU_STATUSLINE_VIEW_ZOOM_50 -#: po/tmp/ap_String_Id.h.h:2564 -msgid "Zoom to 50%" -msgstr "" - -#. MENU_STATUSLINE_VIEW_ZOOM_75 -#: po/tmp/ap_String_Id.h.h:2566 -msgid "Zoom to 75%" -msgstr "" - -#. MENU_STATUSLINE_VIEW_ZOOM_WIDTH -#: po/tmp/ap_String_Id.h.h:2568 -msgid "Zoom to page width" -msgstr "" - -#. MENU_STATUSLINE_VIEW_ZOOM_WHOLE -#: po/tmp/ap_String_Id.h.h:2570 -msgid "Zoom to whole page" -msgstr "" - -#. DLG_Options_Label_CustomDict -#: po/tmp/ap_String_Id.h.h:2572 -msgid "custom.dic" -msgstr "" - -#. FIELD_DateTime_DDMMYY -#: po/tmp/ap_String_Id.h.h:2574 -msgid "dd/mm/yy" -msgstr "" - -#. DLG_ToggleCase_LowerCase -#: po/tmp/ap_String_Id.h.h:2576 -msgid "lowercase" -msgstr "" - -#. DLG_Options_Label_Minutes -#: po/tmp/ap_String_Id.h.h:2578 -msgid "minutes" -msgstr "" - -#. FIELD_DateTime_MMDDYY -#: po/tmp/ap_String_Id.h.h:2580 -msgid "mm/dd/yy" -msgstr "" - -#. DLG_ToggleCase_ToggleCase -#: po/tmp/ap_String_Id.h.h:2582 -msgid "tOGGLE cASE" -msgstr "" - -#. -#. * Translatable strings file generated by extract-ui. -#. * DO NOT compile this file as part of your application. -#. -#. DLG_UP_To -#: po/tmp/xap_String_Id.h.h:7 -msgid " to " -msgstr "" - -#. DLG_Zoom_100 -#: po/tmp/xap_String_Id.h.h:9 -msgid "&100%" -msgstr "" - -#. DLG_Zoom_200 -#: po/tmp/xap_String_Id.h.h:11 -msgid "&200%" -msgstr "" - -#. DLG_Zoom_75 -#: po/tmp/xap_String_Id.h.h:13 -msgid "&75%" -msgstr "" - -#. DLG_Zoom_PageWidth -#: po/tmp/xap_String_Id.h.h:17 -msgid "&Page width" -msgstr "" - -#. DLG_ULANG_SetLangButton -#: po/tmp/xap_String_Id.h.h:19 -msgid "&Set Language" -msgstr "" - -#. DLG_Zoom_WholePage -#: po/tmp/xap_String_Id.h.h:23 -msgid "&Whole page" -msgstr "" - -#. LANG_0 -#: po/tmp/xap_String_Id.h.h:25 -msgid "(no proofing)" -msgstr "" - -#. DLG_DocComparison_TestSkipped -#: po/tmp/xap_String_Id.h.h:27 -msgid "(test skipped)" -msgstr "" - -#. DLG_NoSaveFile_DirNotExist -#: po/tmp/xap_String_Id.h.h:29 -msgid "A directory in the given pathname does not exist." -msgstr "" - -#. DLG_PLUGIN_MANAGER_TITLE -#: po/tmp/xap_String_Id.h.h:31 -msgid "AbiWord Plugin Manager" -msgstr "" - -#. SPELL_CANTLOAD_DLL -#: po/tmp/xap_String_Id.h.h:33 -#, c-format -msgid "" -"AbiWord cannot find the spelling file %s.dll\n" -"Please download and install Aspell from http://aspell.net/win32/" -msgstr "" - -#. MSG_HistoryPartRestore1 -#: po/tmp/xap_String_Id.h.h:35 -#, c-format -msgid "" -"AbiWord cannot fully restore version %d of the document because the version " -"information is incomplete." -msgstr "" - -#. MSG_HistoryNoRestore -#: po/tmp/xap_String_Id.h.h:37 -#, c-format -msgid "" -"AbiWord cannot restore version %d of the document because the version " -"information is missing." -msgstr "" - -#. DLG_UP_PrintPreviewTitle -#: po/tmp/xap_String_Id.h.h:39 -msgid "AbiWord: Print Preview" -msgstr "" - -#. DLG_ABOUT_Title -#: po/tmp/xap_String_Id.h.h:41 -#, c-format -msgid "About %s" -msgstr "" - -#. DLG_PLUGIN_MANAGER_ACTIVE -#: po/tmp/xap_String_Id.h.h:43 -msgid "Active Plugins" -msgstr "" - -#. LANG_AF_ZA -#: po/tmp/xap_String_Id.h.h:45 -msgid "Afrikaans" -msgstr "" - -#. LANG_AK_GH -#: po/tmp/xap_String_Id.h.h:47 -msgid "Akan" -msgstr "" - -#. LANG_SQ_AL -#: po/tmp/xap_String_Id.h.h:49 -msgid "Albanian" -msgstr "" - -#. DLG_FOSA_ALL -#: po/tmp/xap_String_Id.h.h:53 -msgid "All (*.*)" -msgstr "" - -#. DLG_FOSA_ALLDOCS -#: po/tmp/xap_String_Id.h.h:55 -msgid "All Documents" -msgstr "" - -#. DLG_FOSA_ALLIMAGES -#: po/tmp/xap_String_Id.h.h:57 -msgid "All Image Files" -msgstr "" - -#. DLG_HTMLOPT_ExpAllowAWML -#: po/tmp/xap_String_Id.h.h:59 -msgid "Allow extra markup in AWML namespace" -msgstr "" - -#. LANG_AM_ET -#: po/tmp/xap_String_Id.h.h:61 -msgid "Amharic (Ethiopia)" -msgstr "" - -#. LANG_AR -#: po/tmp/xap_String_Id.h.h:65 -msgid "Arabic" -msgstr "" - -#. LANG_AR_EG -#: po/tmp/xap_String_Id.h.h:67 -msgid "Arabic (Egypt)" -msgstr "" - -#. LANG_AR_SA -#: po/tmp/xap_String_Id.h.h:69 -msgid "Arabic (Saudi Arabia)" -msgstr "" - -#. ENC_ARAB_ISO -#: po/tmp/xap_String_Id.h.h:71 -msgid "Arabic, ISO-8859-6" -msgstr "" - -#. ENC_ARAB_MAC -#: po/tmp/xap_String_Id.h.h:73 -msgid "Arabic, Macintosh" -msgstr "" - -#. ENC_ARAB_WIN -#: po/tmp/xap_String_Id.h.h:75 -msgid "Arabic, Windows Code Page 1256" -msgstr "" - -#. LANG_HY_AM -#: po/tmp/xap_String_Id.h.h:77 -msgid "Armenian" -msgstr "" - -#. ENC_ARME_ARMSCII -#: po/tmp/xap_String_Id.h.h:79 -msgid "Armenian, ARMSCII-8" -msgstr "" - -#. LANG_AS_IN -#: po/tmp/xap_String_Id.h.h:81 -msgid "Assamese" -msgstr "" - -#. LANG_AST_ES -#: po/tmp/xap_String_Id.h.h:83 -msgid "Asturian (Spain)" -msgstr "" - -#. DLG_Options_Label_DirMarkerAfterClosingParenthesis -#: po/tmp/xap_String_Id.h.h:87 -msgid "Auto-insert direction markers" -msgstr "" - -#. DLG_History_Version_AutoRevisioned -#: po/tmp/xap_String_Id.h.h:89 -msgid "Auto-revision" -msgstr "" - -#. DLG_FOSA_FileTypeAutoDetect -#: po/tmp/xap_String_Id.h.h:91 -msgid "Automatically Detected" -msgstr "" - -#. MSG_AutoRevision -#: po/tmp/xap_String_Id.h.h:93 -msgid "Autorevision" -msgstr "" - -#. DLG_MW_AvailableDocuments -#: po/tmp/xap_String_Id.h.h:95 -msgid "Available Documents" -msgstr "" - -#. DLG_ULANG_AvailableLanguages -#: po/tmp/xap_String_Id.h.h:97 -msgid "Available Languages" -msgstr "" - -#. LANG_AYM_BO -#: po/tmp/xap_String_Id.h.h:99 -msgid "Aymara (La Paz)" -msgstr "" - -#. LANG_AYC_BO -#: po/tmp/xap_String_Id.h.h:101 -msgid "Aymara (Oruro)" -msgstr "" - -#. ENC_BALT_ISO -#: po/tmp/xap_String_Id.h.h:103 -msgid "Baltic, ISO-8859-4" -msgstr "" - -#. ENC_BALT_WIN -#: po/tmp/xap_String_Id.h.h:105 -msgid "Baltic, Windows Code Page 1257" -msgstr "" - -#. LANG_EU_ES -#: po/tmp/xap_String_Id.h.h:107 -msgid "Basque" -msgstr "" - -#. LANG_BE_BY -#: po/tmp/xap_String_Id.h.h:109 -msgid "Belarusian" -msgstr "" - -#. LANG_BE_LATIN -#: po/tmp/xap_String_Id.h.h:111 -msgid "Belarusian, Latin" -msgstr "" - -#. LANG_BN_IN -#: po/tmp/xap_String_Id.h.h:113 -msgid "Bengali" -msgstr "" - -#. DLG_UP_BlackWhite -#: po/tmp/xap_String_Id.h.h:115 -msgid "Black & White" -msgstr "" - -#. STYLE_BLOCKTEXT -#: po/tmp/xap_String_Id.h.h:117 -msgid "Block Text" -msgstr "" - -#. DLG_UFS_StyleBoldItalic -#: po/tmp/xap_String_Id.h.h:121 -msgid "Bold Italic" -msgstr "" - -#. LANG_BR_FR -#: po/tmp/xap_String_Id.h.h:127 -msgid "Breton" -msgstr "" - -#. MSG_BuildingDoc -#: po/tmp/xap_String_Id.h.h:129 -msgid "Building Document:" -msgstr "" - -#. LANG_BG_BG -#: po/tmp/xap_String_Id.h.h:131 -msgid "Bulgarian" -msgstr "" - -#. DLG_Cancel -#: po/tmp/xap_String_Id.h.h:135 -msgid "Cancel" -msgstr "" - -#. LANG_CA_ES -#: po/tmp/xap_String_Id.h.h:137 -msgid "Catalan" -msgstr "" - -#. LANG_AYR -#: po/tmp/xap_String_Id.h.h:139 -msgid "Central Aymara" -msgstr "" - -#. ENC_CENT_ISO -#: po/tmp/xap_String_Id.h.h:141 -msgid "Central European, ISO-8859-2" -msgstr "" - -#. ENC_CENT_MAC -#: po/tmp/xap_String_Id.h.h:143 -msgid "Central European, Macintosh" -msgstr "" - -#. ENC_CENT_WIN -#: po/tmp/xap_String_Id.h.h:145 -msgid "Central European, Windows Code Page 1250" -msgstr "" - -#. DLG_Options_Label_LangWithKeyboard -#: po/tmp/xap_String_Id.h.h:147 -msgid "Change Language when changing keyboard" -msgstr "" - -#. STYLE_CHAPHEADING -#: po/tmp/xap_String_Id.h.h:149 -msgid "Chapter Heading" -msgstr "" - -#. LANG_ZH_HK -#: po/tmp/xap_String_Id.h.h:151 -msgid "Chinese (Hong Kong)" -msgstr "" - -#. LANG_ZH_CN -#: po/tmp/xap_String_Id.h.h:153 -msgid "Chinese (PRC)" -msgstr "" - -#. LANG_ZH_SG -#: po/tmp/xap_String_Id.h.h:155 -msgid "Chinese (Singapore)" -msgstr "" - -#. LANG_ZH_TW -#: po/tmp/xap_String_Id.h.h:157 -msgid "Chinese (Taiwan)" -msgstr "" - -#. ENC_CHSI_EUC -#: po/tmp/xap_String_Id.h.h:159 -msgid "Chinese Simplified, EUC-CN (GB2312)" -msgstr "" - -#. ENC_CHSI_GB -#: po/tmp/xap_String_Id.h.h:161 -msgid "Chinese Simplified, GB_2312-80" -msgstr "" - -#. ENC_CHSI_HZ -#: po/tmp/xap_String_Id.h.h:163 -msgid "Chinese Simplified, HZ" -msgstr "" - -#. ENC_CHSI_WIN -#: po/tmp/xap_String_Id.h.h:165 -msgid "Chinese Simplified, Windows Code Page 936" -msgstr "" - -#. ENC_CHTR_BIG5 -#: po/tmp/xap_String_Id.h.h:167 -msgid "Chinese Traditional, BIG5" -msgstr "" - -#. ENC_CHTR_BIG5HKSCS -#: po/tmp/xap_String_Id.h.h:169 -msgid "Chinese Traditional, BIG5-HKSCS" -msgstr "" - -#. ENC_CHTR_EUC -#: po/tmp/xap_String_Id.h.h:171 -msgid "Chinese Traditional, EUC-TW" -msgstr "" - -#. ENC_CHTR_WIN -#: po/tmp/xap_String_Id.h.h:173 -msgid "Chinese Traditional, Windows Code Page 950" -msgstr "" - -#. DLG_LISTDOCS_Heading1 -#: po/tmp/xap_String_Id.h.h:175 -msgid "Choose document from the list:" -msgstr "" - -#. TB_ClearBackground -#: po/tmp/xap_String_Id.h.h:177 -msgid "Clear Background" -msgstr "" - -#. DLG_CLIPART_Title -#: po/tmp/xap_String_Id.h.h:179 -msgid "Clip Art" -msgstr "" - -#. DLG_CLIPART_Error -#: po/tmp/xap_String_Id.h.h:181 -msgid "Clip Art could not be loaded" -msgstr "" - -#. DLG_Close -#: po/tmp/xap_String_Id.h.h:183 -msgid "Close" -msgstr "" - -#. DLG_Exit_CloseWithoutSaving -#: po/tmp/xap_String_Id.h.h:185 -msgid "Close &Without Saving" -msgstr "" - -#. DLG_UP_Collate -#: po/tmp/xap_String_Id.h.h:187 -msgid "Collate" -msgstr "" - -#. DLG_UP_Color -#: po/tmp/xap_String_Id.h.h:189 -msgid "Color" -msgstr "" - -#. DLG_Compare -#: po/tmp/xap_String_Id.h.h:193 -msgid "Compare" -msgstr "" - -#. DLG_DocComparison_Content -#: po/tmp/xap_String_Id.h.h:195 -msgid "Content:" -msgstr "" - -#. STYLE_TOCHEADING1 -#: po/tmp/xap_String_Id.h.h:197 -msgid "Contents 1" -msgstr "" - -#. STYLE_TOCHEADING2 -#: po/tmp/xap_String_Id.h.h:199 -msgid "Contents 2" -msgstr "" - -#. STYLE_TOCHEADING3 -#: po/tmp/xap_String_Id.h.h:201 -msgid "Contents 3" -msgstr "" - -#. STYLE_TOCHEADING4 -#: po/tmp/xap_String_Id.h.h:203 -msgid "Contents 4" -msgstr "" - -#. STYLE_TOCHEADING -#: po/tmp/xap_String_Id.h.h:205 -msgid "Contents Header" -msgstr "" - -#. DLG_UP_Copies -#: po/tmp/xap_String_Id.h.h:207 -msgid "Copies: " -msgstr "" - -#. LANG_COP_EG -#: po/tmp/xap_String_Id.h.h:209 -msgid "Coptic" -msgstr "" - -#. LANG_KW_GB -#: po/tmp/xap_String_Id.h.h:211 -msgid "Cornish" -msgstr "" - -#. LANG_CO_FR -#: po/tmp/xap_String_Id.h.h:213 -msgid "Corsican" -msgstr "" - -#. DLG_PLUGIN_MANAGER_COULDNT_LOAD -#: po/tmp/xap_String_Id.h.h:215 -msgid "Could not activate/load plugin" -msgstr "" - -#. DLG_PLUGIN_MANAGER_COULDNT_UNLOAD -#: po/tmp/xap_String_Id.h.h:217 -msgid "Could not deactivate plugin" -msgstr "" - -#. SPELL_CANTLOAD_DICT -#: po/tmp/xap_String_Id.h.h:219 -#, c-format -msgid "Could not load the dictionary for the %s language" -msgstr "" - -#. DLG_History_Version_Started -#: po/tmp/xap_String_Id.h.h:221 -msgid "Created" -msgstr "" - -#. DLG_History_Created -#: po/tmp/xap_String_Id.h.h:223 -msgid "Created:" -msgstr "" - -#. LANG_HR_HR -#: po/tmp/xap_String_Id.h.h:225 -msgid "Croatian" -msgstr "" - -#. ENC_CROA_MAC -#: po/tmp/xap_String_Id.h.h:227 -msgid "Croatian, Macintosh" -msgstr "" - -#. ENC_CYRL_ISO -#: po/tmp/xap_String_Id.h.h:229 -msgid "Cyrillic, ISO-8859-5" -msgstr "" - -#. ENC_CYRL_KOI -#: po/tmp/xap_String_Id.h.h:231 -msgid "Cyrillic, KOI8-R" -msgstr "" - -#. ENC_CYRL_MAC -#: po/tmp/xap_String_Id.h.h:233 -msgid "Cyrillic, Macintosh" -msgstr "" - -#. ENC_CYRL_WIN -#: po/tmp/xap_String_Id.h.h:235 -msgid "Cyrillic, Windows Code Page 1251" -msgstr "" - -#. LANG_CS_CZ -#: po/tmp/xap_String_Id.h.h:237 -msgid "Czech" -msgstr "" - -#. LANG_DA_DK -#: po/tmp/xap_String_Id.h.h:239 -msgid "Danish" -msgstr "" - -#. DLG_PLUGIN_MANAGER_DEACTIVATE_ALL -#: po/tmp/xap_String_Id.h.h:243 -msgid "Deactivate all plugins" -msgstr "" - -#. DLG_PLUGIN_MANAGER_DEACTIVATE -#: po/tmp/xap_String_Id.h.h:245 -msgid "Deactivate plugin" -msgstr "" - -#. DLG_HTMLOPT_ExpDeclareXML -#: po/tmp/xap_String_Id.h.h:247 -msgid "Declare as XML (version 1.0)" -msgstr "" - -#. DLG_ULANG_DefaultLangLabel -#: po/tmp/xap_String_Id.h.h:249 -msgid "Default language: " -msgstr "" - -#. DLG_Image_Placement -#: po/tmp/xap_String_Id.h.h:251 -msgid "Define Image Placement" -msgstr "" - -#. DLG_Image_TextWrapping -#: po/tmp/xap_String_Id.h.h:253 -msgid "Define Text Wrapping" -msgstr "" - -#. DLG_Remove_Icon -#: po/tmp/xap_String_Id.h.h:262 -msgid "Do you want to remove this icon from the toolbar?" -msgstr "" - -#. DLG_DocComparison_WindowLabel -#: po/tmp/xap_String_Id.h.h:264 -msgid "Document Comparison" -msgstr "" - -#. DLG_History_DocumentDetails -#: po/tmp/xap_String_Id.h.h:266 -msgid "Document Details" -msgstr "" - -#. DLG_History_WindowLabel -#: po/tmp/xap_String_Id.h.h:268 -msgid "Document History" -msgstr "" - -#. DLG_History_Path -#: po/tmp/xap_String_Id.h.h:270 -msgid "Document name:" -msgstr "" - -#. DLG_DocComparison_DocsCompared -#: po/tmp/xap_String_Id.h.h:272 -msgid "Documents compared" -msgstr "" - -#. LANG_NL_NL -#: po/tmp/xap_String_Id.h.h:274 -msgid "Dutch (Netherlands)" -msgstr "" - -#. DLG_History_EditTime -#: po/tmp/xap_String_Id.h.h:276 -msgid "Editing time:" -msgstr "" - -#. DLG_UFS_EffectsFrameLabel -#: po/tmp/xap_String_Id.h.h:278 -msgid "Effects" -msgstr "" - -#. DLG_HTMLOPT_ExpEmbedCSS -#: po/tmp/xap_String_Id.h.h:280 -msgid "Embed (CSS) style sheet" -msgstr "" - -#. DLG_UP_EmbedFonts -#: po/tmp/xap_String_Id.h.h:282 -msgid "Embed Fonts" -msgstr "" - -#. DLG_HTMLOPT_ExpEmbedImages -#: po/tmp/xap_String_Id.h.h:284 -msgid "Embed images in URLs (Base64-encoded)" -msgstr "" - -#. DLG_UENC_EncTitle -#: po/tmp/xap_String_Id.h.h:286 -msgid "Encoding" -msgstr "" - -#. DLG_UFS_EncodingLabel -#: po/tmp/xap_String_Id.h.h:288 -msgid "Encoding:" -msgstr "" - -#. STYLE_ENDREFERENCE -#: po/tmp/xap_String_Id.h.h:290 -msgid "Endnote Reference" -msgstr "" - -#. STYLE_ENDTEXT -#: po/tmp/xap_String_Id.h.h:292 -msgid "Endnote Text" -msgstr "" - -#. LANG_EN_AU -#: po/tmp/xap_String_Id.h.h:294 -msgid "English (Australia)" -msgstr "" - -#. LANG_EN_CA -#: po/tmp/xap_String_Id.h.h:296 -msgid "English (Canada)" -msgstr "" - -#. LANG_EN_IE -#: po/tmp/xap_String_Id.h.h:298 -msgid "English (Ireland)" -msgstr "" - -#. LANG_EN_NZ -#: po/tmp/xap_String_Id.h.h:300 -msgid "English (New Zealand)" -msgstr "" - -#. LANG_EN_ZA -#: po/tmp/xap_String_Id.h.h:302 -msgid "English (South Africa)" -msgstr "" - -#. LANG_EN_GB -#: po/tmp/xap_String_Id.h.h:304 -msgid "English (UK)" -msgstr "" - -#. LANG_EN_US -#: po/tmp/xap_String_Id.h.h:306 -msgid "English (US)" -msgstr "" - -#. DLG_Password_Title -#: po/tmp/xap_String_Id.h.h:308 -msgid "Enter Password" -msgstr "" - -#. LANG_EO -#: po/tmp/xap_String_Id.h.h:310 -msgid "Esperanto" -msgstr "" - -#. LANG_ET -#: po/tmp/xap_String_Id.h.h:312 -msgid "Estonian" -msgstr "" - -#. DLG_FOSA_ExportTitle -#: po/tmp/xap_String_Id.h.h:314 -msgid "Export File" -msgstr "" - -#. DLG_HTMLOPT_ExpIs4 -#: po/tmp/xap_String_Id.h.h:316 -msgid "Export as HTML 4.01" -msgstr "" - -#. DLG_HTMLOPT_ExpAbiWebDoc -#: po/tmp/xap_String_Id.h.h:318 -msgid "Export with PHP instructions" -msgstr "" - -#. LANG_FA_IR -#: po/tmp/xap_String_Id.h.h:320 -msgid "Farsi" -msgstr "" - -#. DLG_UP_File -#: po/tmp/xap_String_Id.h.h:322 -msgid "File" -msgstr "" - -#. DLG_OverwriteFile -#: po/tmp/xap_String_Id.h.h:324 -#, c-format -msgid "File already exists. Overwrite file '%s'?" -msgstr "" - -#. DLG_FOSA_RecordToFileLabel -#: po/tmp/xap_String_Id.h.h:326 -msgid "File to record editing:" -msgstr "" - -#. DLG_FOSA_ReplayFromFileLabel -#: po/tmp/xap_String_Id.h.h:328 -msgid "File to replay editing:" -msgstr "" - -#. LANG_FI_FI -#: po/tmp/xap_String_Id.h.h:330 -msgid "Finnish" -msgstr "" - -#. LANG_NL_BE -#: po/tmp/xap_String_Id.h.h:332 -msgid "Flemish (Belgium)" -msgstr "" - -#. STYLE_FOOTREFERENCE -#: po/tmp/xap_String_Id.h.h:339 -msgid "Footnote Reference" -msgstr "" - -#. STYLE_FOOTTEXT -#: po/tmp/xap_String_Id.h.h:341 -msgid "Footnote Text" -msgstr "" - -#. LANG_FR_BE -#: po/tmp/xap_String_Id.h.h:345 -msgid "French (Belgium)" -msgstr "" - -#. LANG_FR_CA -#: po/tmp/xap_String_Id.h.h:347 -msgid "French (Canada)" -msgstr "" - -#. LANG_FR_FR -#: po/tmp/xap_String_Id.h.h:349 -msgid "French (France)" -msgstr "" - -#. LANG_FR_CH -#: po/tmp/xap_String_Id.h.h:351 -msgid "French (Switzerland)" -msgstr "" - -#. LANG_FY_NL -#: po/tmp/xap_String_Id.h.h:353 -msgid "Frisian" -msgstr "" - -#. DLG_UP_From -#: po/tmp/xap_String_Id.h.h:355 -msgid "From: " -msgstr "" - -#. LANG_GL -#: po/tmp/xap_String_Id.h.h:357 -msgid "Galician (Galego)" -msgstr "" - -#. LANG_KA_GE -#: po/tmp/xap_String_Id.h.h:359 -msgid "Georgian" -msgstr "" - -#. ENC_GEOR_ACADEMY -#: po/tmp/xap_String_Id.h.h:361 -msgid "Georgian, Academy" -msgstr "" - -#. ENC_GEOR_PS -#: po/tmp/xap_String_Id.h.h:363 -msgid "Georgian, PS" -msgstr "" - -#. LANG_DE_AT -#: po/tmp/xap_String_Id.h.h:365 -msgid "German (Austria)" -msgstr "" - -#. LANG_DE_DE -#: po/tmp/xap_String_Id.h.h:367 -msgid "German (Germany)" -msgstr "" - -#. LANG_DE_CH -#: po/tmp/xap_String_Id.h.h:369 -msgid "German (Switzerland)" -msgstr "" - -#. DLG_UP_Grayscale -#: po/tmp/xap_String_Id.h.h:371 -msgid "Grayscale" -msgstr "" - -#. LANG_EL_GR -#: po/tmp/xap_String_Id.h.h:373 -msgid "Greek" -msgstr "" - -#. ENC_GREE_ISO -#: po/tmp/xap_String_Id.h.h:375 -msgid "Greek, ISO-8859-7" -msgstr "" - -#. ENC_GREE_MAC -#: po/tmp/xap_String_Id.h.h:377 -msgid "Greek, Macintosh" -msgstr "" - -#. ENC_GREE_WIN -#: po/tmp/xap_String_Id.h.h:379 -msgid "Greek, Windows Code Page 1253" -msgstr "" - -#. DLG_HTMLOPT_ExpTitle -#: po/tmp/xap_String_Id.h.h:381 -msgid "HTML Export Options" -msgstr "" - -#. LANG_HA_NE -#: po/tmp/xap_String_Id.h.h:385 -msgid "Hausa (Niger)" -msgstr "" - -#. LANG_HA_NG -#: po/tmp/xap_String_Id.h.h:387 -msgid "Hausa (Nigeria)" -msgstr "" - -#. LANG_HAW_US -#: po/tmp/xap_String_Id.h.h:389 -msgid "Hawaiian" -msgstr "" - -#. STYLE_HEADING1 -#: po/tmp/xap_String_Id.h.h:391 -msgid "Heading 1" -msgstr "" - -#. STYLE_HEADING2 -#: po/tmp/xap_String_Id.h.h:393 -msgid "Heading 2" -msgstr "" - -#. STYLE_HEADING3 -#: po/tmp/xap_String_Id.h.h:395 -msgid "Heading 3" -msgstr "" - -#. STYLE_HEADING4 -#: po/tmp/xap_String_Id.h.h:397 -msgid "Heading 4" -msgstr "" - -#. LANG_HE_IL -#: po/tmp/xap_String_Id.h.h:401 -msgid "Hebrew" -msgstr "" - -#. ENC_HEBR_ISO -#: po/tmp/xap_String_Id.h.h:403 -msgid "Hebrew, ISO-8859-8" -msgstr "" - -#. ENC_HEBR_MAC -#: po/tmp/xap_String_Id.h.h:405 -msgid "Hebrew, Macintosh" -msgstr "" - -#. ENC_HEBR_WIN -#: po/tmp/xap_String_Id.h.h:407 -msgid "Hebrew, Windows Code Page 1255" -msgstr "" - -#. DLG_Image_Height -#: po/tmp/xap_String_Id.h.h:409 -msgid "Height:" -msgstr "" - -#. DLG_IP_Height_Label -#: po/tmp/xap_String_Id.h.h:411 -msgid "Height: " -msgstr "" - -#. DLG_UFS_HiddenCheck -#: po/tmp/xap_String_Id.h.h:413 -msgid "Hidden" -msgstr "" - -#. DLG_UFS_BGColorTab -#: po/tmp/xap_String_Id.h.h:415 -msgid "HighLight Color" -msgstr "" - -#. LANG_HI_IN -#: po/tmp/xap_String_Id.h.h:417 -msgid "Hindi" -msgstr "" - -#. LANG_HU_HU -#: po/tmp/xap_String_Id.h.h:419 -msgid "Hungarian" -msgstr "" - -#. LANG_IS_IS -#: po/tmp/xap_String_Id.h.h:421 -msgid "Icelandic" -msgstr "" - -#. ENC_ICEL_MAC -#: po/tmp/xap_String_Id.h.h:423 -msgid "Icelandic, Macintosh" -msgstr "" - -#. DLG_History_Id -#: po/tmp/xap_String_Id.h.h:425 -msgid "Identifier:" -msgstr "" - -#. DLG_Image_Title -#: po/tmp/xap_String_Id.h.h:427 -msgid "Image Properties" -msgstr "" - -#. DLG_Image_WrappedNone -#: po/tmp/xap_String_Id.h.h:429 -msgid "Image floats above text" -msgstr "" - -#. DLG_Image_InLine -#: po/tmp/xap_String_Id.h.h:431 -msgid "Image placed in-line (no text wrapping)" -msgstr "" - -#. DLG_FOSA_ImportTitle -#: po/tmp/xap_String_Id.h.h:435 -msgid "Import File" -msgstr "" - -#. MSG_ImportingDoc -#: po/tmp/xap_String_Id.h.h:437 -msgid "Importing Document..." -msgstr "" - -#. LANG_ID_ID -#: po/tmp/xap_String_Id.h.h:439 -msgid "Indonesian" -msgstr "" - -#. XIM_Methods -#: po/tmp/xap_String_Id.h.h:441 -msgid "Input Methods" -msgstr "" - -#. DLG_FOSA_InsertObject -#: po/tmp/xap_String_Id.h.h:445 -msgid "Insert Embeddable Object" -msgstr "" - -#. DLG_FOSA_FileInsertObject -#: po/tmp/xap_String_Id.h.h:447 -msgid "Insert Embeddable Object file:" -msgstr "" - -#. DLG_FOSA_InsertTitle -#: po/tmp/xap_String_Id.h.h:449 -msgid "Insert File" -msgstr "" - -#. DLG_FOSA_InsertMath -#: po/tmp/xap_String_Id.h.h:451 -msgid "Insert Math File" -msgstr "" - -#. DLG_FOSA_FileInsertMath -#: po/tmp/xap_String_Id.h.h:453 -msgid "Insert MathML file:" -msgstr "" - -#. TB_InsertNewTable -#: po/tmp/xap_String_Id.h.h:455 -msgid "Insert New Table" -msgstr "" - -#. DLG_IP_Title -#: po/tmp/xap_String_Id.h.h:457 -msgid "Insert Picture" -msgstr "" - -#. DLG_Insert_SymbolTitle -#: po/tmp/xap_String_Id.h.h:459 -msgid "Insert Symbol" -msgstr "" - -#. DLG_PLUGIN_MANAGER_INSTALL -#: po/tmp/xap_String_Id.h.h:461 -msgid "Install new plugin" -msgstr "" - -#. LANG_IA -#: po/tmp/xap_String_Id.h.h:463 -msgid "Interlingua" -msgstr "" - -#. LANG_IU_CA -#: po/tmp/xap_String_Id.h.h:465 -msgid "Inuktitut" -msgstr "" - -#. DLG_InvalidPathname -#: po/tmp/xap_String_Id.h.h:467 -msgid "Invalid pathname." -msgstr "" - -#. LANG_GA_IE -#: po/tmp/xap_String_Id.h.h:469 -msgid "Irish" -msgstr "" - -#. LANG_IT_IT -#: po/tmp/xap_String_Id.h.h:471 -msgid "Italian (Italy)" -msgstr "" - -#. LANG_JA_JP -#: po/tmp/xap_String_Id.h.h:475 -msgid "Japanese" -msgstr "" - -#. ENC_JAPN_EUC -#: po/tmp/xap_String_Id.h.h:477 -msgid "Japanese, EUC-JP" -msgstr "" - -#. ENC_JAPN_ISO -#: po/tmp/xap_String_Id.h.h:479 -msgid "Japanese, ISO-2022-JP" -msgstr "" - -#. ENC_JAPN_SJIS -#: po/tmp/xap_String_Id.h.h:481 -msgid "Japanese, Shift-JIS" -msgstr "" - -#. ENC_JAPN_WIN -#: po/tmp/xap_String_Id.h.h:483 -msgid "Japanese, Windows Code Page 932" -msgstr "" - -#. LANG_KN_IN -#: po/tmp/xap_String_Id.h.h:485 -msgid "Kannada" -msgstr "" - -#. LANG_KO_KR -#. LANG_KO -#: po/tmp/xap_String_Id.h.h:488 -msgid "Korean" -msgstr "" - -#. ENC_KORE_EUC -#: po/tmp/xap_String_Id.h.h:490 -msgid "Korean, EUC-KR" -msgstr "" - -#. ENC_KORE_JOHAB -#: po/tmp/xap_String_Id.h.h:492 -msgid "Korean, Johab" -msgstr "" - -#. ENC_KORE_KSC -#: po/tmp/xap_String_Id.h.h:494 -msgid "Korean, KSC_5601" -msgstr "" - -#. ENC_KORE_WIN -#: po/tmp/xap_String_Id.h.h:496 -msgid "Korean, Windows Code Page 949" -msgstr "" - -#. LANG_KU -#: po/tmp/xap_String_Id.h.h:498 -msgid "Kurdish" -msgstr "" - -#. LANG_LO_LA -#: po/tmp/xap_String_Id.h.h:500 -msgid "Lao" -msgstr "" - -#. DLG_History_LastSaved -#: po/tmp/xap_String_Id.h.h:502 -msgid "Last saved:" -msgstr "" - -#. LANG_LA_IT -#: po/tmp/xap_String_Id.h.h:504 -msgid "Latin (Renaissance)" -msgstr "" - -#. LANG_LV_LV -#: po/tmp/xap_String_Id.h.h:506 -msgid "Latvian" -msgstr "" - -#. LANG_LT_LT -#: po/tmp/xap_String_Id.h.h:508 -msgid "Lithuanian" -msgstr "" - -#. DLG_CLIPART_Loading -#: po/tmp/xap_String_Id.h.h:510 -msgid "Loading Clip Art" -msgstr "" - -#. LANG_MK -#: po/tmp/xap_String_Id.h.h:516 -msgid "Macedonian" -msgstr "" - -#. DLG_ULANG_DefaultLangChkbox -#: po/tmp/xap_String_Id.h.h:518 -msgid "Make default for document" -msgstr "" - -#. LANG_MS_MY -#: po/tmp/xap_String_Id.h.h:520 -msgid "Malay" -msgstr "" - -#. LANG_MI_NZ -#: po/tmp/xap_String_Id.h.h:522 -msgid "Maori" -msgstr "" - -#. LANG_MR_IN -#: po/tmp/xap_String_Id.h.h:524 -msgid "Marathi" -msgstr "" - -#. LANG_MH_MH -#: po/tmp/xap_String_Id.h.h:526 -msgid "Marshallese (Marshall Islands)" -msgstr "" - -#. LANG_MH_NR -#: po/tmp/xap_String_Id.h.h:528 -msgid "Marshallese (Nauru)" -msgstr "" - -#. DLG_Merge -#: po/tmp/xap_String_Id.h.h:530 -msgid "Merge" -msgstr "" - -#. LANG_MN_MN -#: po/tmp/xap_String_Id.h.h:532 -msgid "Mongolian" -msgstr "" - -#. DLG_PLUGIN_MANAGER_NAME -#: po/tmp/xap_String_Id.h.h:534 -msgid "Name:" -msgstr "" - -#. LANG_NE_NP -#: po/tmp/xap_String_Id.h.h:536 -msgid "Nepali (Nepal)" -msgstr "" - -#. DLG_QNXMB_No -#: po/tmp/xap_String_Id.h.h:538 -msgid "No" -msgstr "" - -#. DLG_IP_No_Picture_Label -#: po/tmp/xap_String_Id.h.h:540 -msgid "No Picture" -msgstr "" - -#. DLG_PLUGIN_MANAGER_NONE_SELECTED -#: po/tmp/xap_String_Id.h.h:542 -msgid "No plugin selected" -msgstr "" - -#. STYLE_NORMAL -#: po/tmp/xap_String_Id.h.h:544 -msgid "Normal" -msgstr "" - -#. LANG_NB_NO -#: po/tmp/xap_String_Id.h.h:546 -msgid "Norwegian Bokmal" -msgstr "" - -#. LANG_NN_NO -#: po/tmp/xap_String_Id.h.h:548 -msgid "Norwegian Nynorsk" -msgstr "" - -#. DLG_PLUGIN_MANAGER_NOT_AVAILABLE -#: po/tmp/xap_String_Id.h.h:550 -msgid "Not available" -msgstr "" - -#. STYLE_NUMHEAD1 -#: po/tmp/xap_String_Id.h.h:552 -msgid "Numbered Heading 1" -msgstr "" - -#. STYLE_NUMHEAD2 -#: po/tmp/xap_String_Id.h.h:554 -msgid "Numbered Heading 2" -msgstr "" - -#. STYLE_NUMHEAD3 -#: po/tmp/xap_String_Id.h.h:556 -msgid "Numbered Heading 3" -msgstr "" - -#. DLG_OK -#: po/tmp/xap_String_Id.h.h:560 -msgid "OK" -msgstr "" - -#. LANG_OC_FR -#: po/tmp/xap_String_Id.h.h:562 -msgid "Occitan" -msgstr "" - -#. DLG_FOSA_OpenTitle -#: po/tmp/xap_String_Id.h.h:564 -msgid "Open File" -msgstr "" - -#. DLG_FOSA_FileOpenTypeLabel -#: po/tmp/xap_String_Id.h.h:566 -msgid "Open file as type:" -msgstr "" - -#. DLG_LISTDOCS_Title -#: po/tmp/xap_String_Id.h.h:568 -msgid "Opened Documents" -msgstr "" - -#. TB_Zoom_Percent -#: po/tmp/xap_String_Id.h.h:570 -msgid "Other..." -msgstr "" - -#. DLG_Zoom_Percent -#: po/tmp/xap_String_Id.h.h:574 -msgid "P&ercent:" -msgstr "" - -#. TB_Zoom_PageWidth -#: po/tmp/xap_String_Id.h.h:576 -msgid "Page Width" -msgstr "" - -#. DLG_UP_PageRanges -#: po/tmp/xap_String_Id.h.h:578 -msgid "Page ranges:" -msgstr "" - -#. LANG_PS -#: po/tmp/xap_String_Id.h.h:580 -msgid "Pashto" -msgstr "" - -#. DLG_Password_Password -#: po/tmp/xap_String_Id.h.h:582 -msgid "Password:" -msgstr "" - -#. STYLE_PLAIN_TEXT -#: po/tmp/xap_String_Id.h.h:584 -msgid "Plain Text" -msgstr "" - -#. DLG_PLUGIN_MANAGER_DETAILS -#: po/tmp/xap_String_Id.h.h:586 -msgid "Plugin Details:" -msgstr "" - -#. DLG_PLUGIN_MANAGER_LIST -#: po/tmp/xap_String_Id.h.h:588 -msgid "Plugin List" -msgstr "" - -#. LANG_PL_PL -#: po/tmp/xap_String_Id.h.h:590 -msgid "Polish" -msgstr "" - -#. LANG_PT_BR -#: po/tmp/xap_String_Id.h.h:592 -msgid "Portuguese (Brazil)" -msgstr "" - -#. LANG_PT_PT -#: po/tmp/xap_String_Id.h.h:594 -msgid "Portuguese (Portugal)" -msgstr "" - -#. DLG_Image_PlaceColumn -#: po/tmp/xap_String_Id.h.h:596 -msgid "Position relative to its Column" -msgstr "" - -#. DLG_Image_PlacePage -#: po/tmp/xap_String_Id.h.h:598 -msgid "Position relative to its Page" -msgstr "" - -#. DLG_Image_PlaceParagraph -#: po/tmp/xap_String_Id.h.h:600 -msgid "Position relative to nearest paragraph" -msgstr "" - -#. DLG_Image_Aspect -#: po/tmp/xap_String_Id.h.h:602 -msgid "Preserve aspect ratio" -msgstr "" - -#. DLG_IP_Activate_Label -#: po/tmp/xap_String_Id.h.h:606 -msgid "Preview Picture" -msgstr "" - -#. DLG_FOSA_PrintToFileTitle -#: po/tmp/xap_String_Id.h.h:611 -msgid "Print To File" -msgstr "" - -#. DLG_FOSA_FilePrintTypeLabel -#: po/tmp/xap_String_Id.h.h:613 -msgid "Print file as type:" -msgstr "" - -#. DLG_UP_PrintIn -#: po/tmp/xap_String_Id.h.h:615 -msgid "Print in: " -msgstr "" - -#. DLG_UP_PrintTo -#: po/tmp/xap_String_Id.h.h:617 -msgid "Print to: " -msgstr "" - -#. DLG_UP_Printer -#: po/tmp/xap_String_Id.h.h:619 -msgid "Printer" -msgstr "" - -#. DLG_UP_PrinterCommand -#: po/tmp/xap_String_Id.h.h:621 -msgid "Printer command: " -msgstr "" - -#. LANG_PA_IN -#: po/tmp/xap_String_Id.h.h:623 -msgid "Punjabi (Gurmukhi)" -msgstr "" - -#. LANG_PA_PK -#: po/tmp/xap_String_Id.h.h:625 -msgid "Punjabi (Shahmukhi)" -msgstr "" - -#. LANG_QU_BO -#: po/tmp/xap_String_Id.h.h:627 -msgid "Quechua" -msgstr "" - -#. LANG_QUH_BO -#: po/tmp/xap_String_Id.h.h:629 -msgid "Quechua (3 vowels)" -msgstr "" - -#. LANG_QUL_BO -#: po/tmp/xap_String_Id.h.h:631 -msgid "Quechua (5 vowels)" -msgstr "" - -#. DLG_FOSA_RecordToFileTitle -#: po/tmp/xap_String_Id.h.h:633 -msgid "Record Editing to File" -msgstr "" - -#. DLG_UFS_StyleRegular -#: po/tmp/xap_String_Id.h.h:635 -msgid "Regular" -msgstr "" - -#. DLG_DocComparison_Relationship -#: po/tmp/xap_String_Id.h.h:637 -msgid "Relationship:" -msgstr "" - -#. DLG_FOSA_ReplayFromFileTitle -#: po/tmp/xap_String_Id.h.h:639 -msgid "Replay Editing from File" -msgstr "" - -#. DLG_Restore -#: po/tmp/xap_String_Id.h.h:641 -msgid "Restore" -msgstr "" - -#. DLG_HTMLOPT_ExpRestore -#: po/tmp/xap_String_Id.h.h:643 -msgid "Restore Settings" -msgstr "" - -#. DLG_DocComparison_Results -#: po/tmp/xap_String_Id.h.h:645 -msgid "Results" -msgstr "" - -#. LANG_RO_RO -#: po/tmp/xap_String_Id.h.h:647 -msgid "Romanian" -msgstr "" - -#. ENC_ROMA_MAC -#: po/tmp/xap_String_Id.h.h:649 -msgid "Romanian, Macintosh" -msgstr "" - -#. LANG_RU_RU -#: po/tmp/xap_String_Id.h.h:651 -msgid "Russian (Russia)" -msgstr "" - -#. DLG_UFS_SampleFrameLabel -#: po/tmp/xap_String_Id.h.h:653 -msgid "Sample" -msgstr "" - -#. LANG_SC_IT -#: po/tmp/xap_String_Id.h.h:655 -msgid "Sardinian" -msgstr "" - -#. DLG_FOSA_SaveAsTitle -#: po/tmp/xap_String_Id.h.h:657 -msgid "Save File As" -msgstr "" - -#. DLG_HTMLOPT_ExpSave -#: po/tmp/xap_String_Id.h.h:659 -msgid "Save Settings" -msgstr "" - -#. DLG_FOSA_FileSaveTypeLabel -#: po/tmp/xap_String_Id.h.h:661 -msgid "Save file as type:" -msgstr "" - -#. DLG_UFS_ScriptLabel -#: po/tmp/xap_String_Id.h.h:663 -msgid "Script:" -msgstr "" - -#. STYLE_SECTHEADING -#: po/tmp/xap_String_Id.h.h:665 -msgid "Section Heading" -msgstr "" - -#. DLG_UENC_EncLabel -#: po/tmp/xap_String_Id.h.h:669 -msgid "Select Encoding:" -msgstr "" - -#. DLG_HTMLOPT_ExpLabel -#: po/tmp/xap_String_Id.h.h:671 -msgid "Select HTML export options:" -msgstr "" - -#. DLG_ULANG_LangLabel -#: po/tmp/xap_String_Id.h.h:673 -msgid "Select Language:" -msgstr "" - -#. LANG_SR -#: po/tmp/xap_String_Id.h.h:677 -msgid "Serbian" -msgstr "" - -#. DLG_Image_ImageDesc -#: po/tmp/xap_String_Id.h.h:679 -msgid "Set Image Name" -msgstr "" - -#. DLG_Image_ImageSize -#: po/tmp/xap_String_Id.h.h:681 -msgid "Set Image Size" -msgstr "" - -#. DLG_ULANG_LangTitle -#: po/tmp/xap_String_Id.h.h:683 -msgid "Set Language" -msgstr "" - -#. DLG_UFS_TransparencyCheck -#: po/tmp/xap_String_Id.h.h:685 -msgid "Set no Highlight Color" -msgstr "" - -#. DLG_UFS_SizeLabel -#: po/tmp/xap_String_Id.h.h:689 -msgid "Size:" -msgstr "" - -#. LANG_SK_SK -#: po/tmp/xap_String_Id.h.h:691 -msgid "Slovak" -msgstr "" - -#. LANG_SL_SI -#: po/tmp/xap_String_Id.h.h:693 -msgid "Slovenian" -msgstr "" - -#. LANG_ES_MX -#: po/tmp/xap_String_Id.h.h:695 -msgid "Spanish (Mexico)" -msgstr "" - -#. LANG_ES_ES -#: po/tmp/xap_String_Id.h.h:697 -msgid "Spanish (Spain)" -msgstr "" - -#. DLG_Image_SquareWrap -#: po/tmp/xap_String_Id.h.h:701 -msgid "Square text wrapping" -msgstr "" - -#. DLG_DocComparison_Styles -#: po/tmp/xap_String_Id.h.h:709 -msgid "Styles:" -msgstr "" - -#. LANG_SW -#: po/tmp/xap_String_Id.h.h:715 -msgid "Swahili" -msgstr "" - -#. LANG_SV_SE -#: po/tmp/xap_String_Id.h.h:717 -msgid "Swedish" -msgstr "" - -#. TB_Font_Symbol -#: po/tmp/xap_String_Id.h.h:719 -msgid "Symbols" -msgstr "" - -#. LANG_SYR -#: po/tmp/xap_String_Id.h.h:721 -msgid "Syriac" -msgstr "" - -#. LANG_TL_PH -#: po/tmp/xap_String_Id.h.h:725 -msgid "Tagalog" -msgstr "" - -#. LANG_TA_IN -#: po/tmp/xap_String_Id.h.h:727 -msgid "Tamil" -msgstr "" - -#. LANG_TE_IN -#: po/tmp/xap_String_Id.h.h:729 -msgid "Telugu" -msgstr "" - -#. DLG_UFS_ColorTab -#: po/tmp/xap_String_Id.h.h:731 -msgid "Text Color" -msgstr "" - -#. DLG_Image_WrappedBoth -#: po/tmp/xap_String_Id.h.h:733 -msgid "Text wrapped on both sides of the Image" -msgstr "" - -#. DLG_Image_WrappedLeft -#: po/tmp/xap_String_Id.h.h:735 -msgid "Text wrapped to the Left of the Image" -msgstr "" - -#. DLG_Image_WrappedRight -#: po/tmp/xap_String_Id.h.h:737 -msgid "Text wrapped to the Right of the Image" -msgstr "" - -#. LANG_TH_TH -#: po/tmp/xap_String_Id.h.h:739 -msgid "Thai" -msgstr "" - -#. ENC_THAI_MAC -#: po/tmp/xap_String_Id.h.h:741 -msgid "Thai, Macintosh" -msgstr "" - -#. ENC_THAI_TIS -#: po/tmp/xap_String_Id.h.h:743 -msgid "Thai, TIS-620" -msgstr "" - -#. ENC_THAI_WIN -#: po/tmp/xap_String_Id.h.h:745 -msgid "Thai, Windows Code Page 874" -msgstr "" - -#. DLG_NoSaveFile_DirNotWriteable -#: po/tmp/xap_String_Id.h.h:747 -#, c-format -msgid "The directory '%s' is write-protected." -msgstr "" - -#. DLG_FOSA_ExtensionDoesNotMatch -#: po/tmp/xap_String_Id.h.h:749 -msgid "" -"The given file extension does not match the chosen file type. Do you want to " -"use this name anyway?" -msgstr "" - -#. MSG_HistoryPartRestore2 -#: po/tmp/xap_String_Id.h.h:751 -#, c-format -msgid "" -"The nearest version that can be restored fully is %d. Would you like to " -"restore this version instead? To partially restore version %d press No." -msgstr "" - -#. DLG_UP_InvalidPrintString -#: po/tmp/xap_String_Id.h.h:753 -msgid "The print command string is not valid." -msgstr "" - -#. MSG_NoUndo -#: po/tmp/xap_String_Id.h.h:755 -msgid "This operation cannot be undone. Are you sure you want to proceed?" -msgstr "" - -#. DLG_Image_TightWrap -#: po/tmp/xap_String_Id.h.h:759 -msgid "Tight text wrapping" -msgstr "" - -#. MSG_HistoryPartRestore3 -#: po/tmp/xap_String_Id.h.h:763 -msgid "To continue anyway, press OK." -msgstr "" - -#. MSG_HistoryPartRestore4 -#: po/tmp/xap_String_Id.h.h:765 -msgid "To quit the restoration attempt, press Cancel." -msgstr "" - -#. LANG_TR_TR -#: po/tmp/xap_String_Id.h.h:771 -msgid "Turkish" -msgstr "" - -#. ENC_TURK_ISO -#: po/tmp/xap_String_Id.h.h:773 -msgid "Turkish, ISO-8859-9" -msgstr "" - -#. ENC_TURK_MAC -#: po/tmp/xap_String_Id.h.h:775 -msgid "Turkish, Macintosh" -msgstr "" - -#. ENC_TURK_WIN -#: po/tmp/xap_String_Id.h.h:777 -msgid "Turkish, Windows Code Page 1254" -msgstr "" - -#. DLG_Image_WrapType -#: po/tmp/xap_String_Id.h.h:779 -msgid "Type of text wrapping" -msgstr "" - -#. ENC_WEST_ASCII -#: po/tmp/xap_String_Id.h.h:781 -msgid "US-ASCII" -msgstr "" - -#. LANG_UK_UA -#: po/tmp/xap_String_Id.h.h:783 -msgid "Ukrainian" -msgstr "" - -#. ENC_UKRA_KOI -#: po/tmp/xap_String_Id.h.h:785 -msgid "Ukrainian, KOI8-U" -msgstr "" - -#. ENC_UKRA_MAC -#: po/tmp/xap_String_Id.h.h:787 -msgid "Ukrainian, Macintosh" -msgstr "" - -#. ENC_UNIC_UCS2 -#: po/tmp/xap_String_Id.h.h:791 -msgid "Unicode UCS-2" -msgstr "" - -#. ENC_UNIC_UCS_2BE -#: po/tmp/xap_String_Id.h.h:793 -msgid "Unicode UCS-2 Big Endian" -msgstr "" - -#. ENC_UNIC_UCS_2LE -#: po/tmp/xap_String_Id.h.h:795 -msgid "Unicode UCS-2 Little Endian" -msgstr "" - -#. ENC_UNIC_UCS4 -#: po/tmp/xap_String_Id.h.h:797 -msgid "Unicode UCS-4" -msgstr "" - -#. ENC_UNIC_UCS_4BE -#: po/tmp/xap_String_Id.h.h:799 -msgid "Unicode UCS-4 Big Endian" -msgstr "" - -#. ENC_UNIC_UCS_4LE -#: po/tmp/xap_String_Id.h.h:801 -msgid "Unicode UCS-4 Little Endian" -msgstr "" - -#. ENC_UNIC_UTF_16 -#: po/tmp/xap_String_Id.h.h:803 -msgid "Unicode UTF-16" -msgstr "" - -#. ENC_UNIC_UTF_16BE -#: po/tmp/xap_String_Id.h.h:805 -msgid "Unicode UTF-16 Big Endian" -msgstr "" - -#. ENC_UNIC_UTF_16LE -#: po/tmp/xap_String_Id.h.h:807 -msgid "Unicode UTF-16 Little Endian" -msgstr "" - -#. ENC_UNIC_UTF_32 -#: po/tmp/xap_String_Id.h.h:809 -msgid "Unicode UTF-32" -msgstr "" - -#. ENC_UNIC_UTF_32BE -#: po/tmp/xap_String_Id.h.h:811 -msgid "Unicode UTF-32 Big Endian" -msgstr "" - -#. ENC_UNIC_UTF_32LE -#: po/tmp/xap_String_Id.h.h:813 -msgid "Unicode UTF-32 Little Endian" -msgstr "" - -#. ENC_UNIC_UTF_7 -#: po/tmp/xap_String_Id.h.h:815 -msgid "Unicode UTF-7" -msgstr "" - -#. ENC_UNIC_UTF_8 -#: po/tmp/xap_String_Id.h.h:817 -msgid "Unicode UTF-8" -msgstr "" - -#. UntitledDocument -#: po/tmp/xap_String_Id.h.h:819 -#, c-format -msgid "Untitled%d" -msgstr "" - -#. DLG_Update -#: po/tmp/xap_String_Id.h.h:821 -msgid "Update" -msgstr "" - -#. LANG_UR -#: po/tmp/xap_String_Id.h.h:827 -msgid "Urdu" -msgstr "" - -#. LANG_UR_PK -#: po/tmp/xap_String_Id.h.h:829 -msgid "Urdu (Pakistan)" -msgstr "" - -#. LANG_UZ_UZ -#: po/tmp/xap_String_Id.h.h:831 -msgid "Uzbek" -msgstr "" - -#. DLG_History_List_Title -#: po/tmp/xap_String_Id.h.h:835 -msgid "Version history" -msgstr "" - -#. DLG_PLUGIN_MANAGER_VERSION -#. DLG_History_Version -#: po/tmp/xap_String_Id.h.h:838 -msgid "Version:" -msgstr "" - -#. LANG_VI_VN -#: po/tmp/xap_String_Id.h.h:840 -msgid "Vietnamese" -msgstr "" - -#. ENC_VIET_TCVN -#: po/tmp/xap_String_Id.h.h:842 -msgid "Vietnamese, TCVN" -msgstr "" - -#. ENC_VIET_VISCII -#: po/tmp/xap_String_Id.h.h:844 -msgid "Vietnamese, VISCII" -msgstr "" - -#. ENC_VIET_WIN -#: po/tmp/xap_String_Id.h.h:846 -msgid "Vietnamese, Windows Code Page 1258" -msgstr "" - -#. DLG_MW_MoreWindows -#: po/tmp/xap_String_Id.h.h:848 -msgid "View Document" -msgstr "" - -#. DLG_MW_Activate -#: po/tmp/xap_String_Id.h.h:850 -msgid "View:" -msgstr "" - -#. LANG_CY_GB -#: po/tmp/xap_String_Id.h.h:852 -msgid "Welsh" -msgstr "" - -#. ENC_US_DOS -#: po/tmp/xap_String_Id.h.h:854 -msgid "Western European, DOS/Windows Code Page 437" -msgstr "" - -#. ENC_MLNG_DOS -#: po/tmp/xap_String_Id.h.h:856 -msgid "Western European, DOS/Windows Code Page 850" -msgstr "" - -#. ENC_WEST_HP -#: po/tmp/xap_String_Id.h.h:858 -msgid "Western European, HP" -msgstr "" - -#. ENC_WEST_ISO -#: po/tmp/xap_String_Id.h.h:860 -msgid "Western European, ISO-8859-1" -msgstr "" - -#. ENC_WEST_MAC -#: po/tmp/xap_String_Id.h.h:862 -msgid "Western European, Macintosh" -msgstr "" - -#. ENC_WEST_NXT -#: po/tmp/xap_String_Id.h.h:864 -msgid "Western European, NeXT" -msgstr "" - -#. ENC_WEST_WIN -#: po/tmp/xap_String_Id.h.h:866 -msgid "Western European, Windows Code Page 1252" -msgstr "" - -#. TB_Zoom_WholePage -#: po/tmp/xap_String_Id.h.h:868 -msgid "Whole Page" -msgstr "" - -#. DLG_Image_Width -#: po/tmp/xap_String_Id.h.h:870 -msgid "Width:" -msgstr "" - -#. DLG_IP_Width_Label -#: po/tmp/xap_String_Id.h.h:872 -msgid "Width: " -msgstr "" - -#. LANG_WO_SN -#: po/tmp/xap_String_Id.h.h:874 -msgid "Wolof (Senegal)" -msgstr "" - -#. DLG_QNXMB_Yes -#: po/tmp/xap_String_Id.h.h:876 -msgid "Yes" -msgstr "" - -#. LANG_YI -#: po/tmp/xap_String_Id.h.h:878 -msgid "Yiddish" -msgstr "" - -#. MSG_HistoryConfirmSave -#: po/tmp/xap_String_Id.h.h:880 -#, c-format -msgid "You have to save changes to document %s before proceeding. Save now?" -msgstr "" - -#. DLG_Zoom_RadioFrameCaption -#: po/tmp/xap_String_Id.h.h:884 -msgid "Zoom to" -msgstr "" - -#. DLG_UnixMB_No -#: po/tmp/xap_String_Id.h.h:886 -msgid "_No" -msgstr "" - -#. DLG_UnixMB_Yes -#: po/tmp/xap_String_Id.h.h:888 -msgid "_Yes" -msgstr "" - -#. DLG_Unit_cm -#: po/tmp/xap_String_Id.h.h:890 -msgid "cm" -msgstr "" - -#. DLG_DocComparison_Different -#: po/tmp/xap_String_Id.h.h:892 -msgid "different" -msgstr "" - -#. DLG_DocComparison_DivergingPos -#: po/tmp/xap_String_Id.h.h:894 -#, c-format -msgid "diverging after document position %d" -msgstr "" - -#. DLG_DocComparison_Diverging -#: po/tmp/xap_String_Id.h.h:896 -#, c-format -msgid "diverging after version %d of %s" -msgstr "" - -#. DLG_DocComparison_Identical -#: po/tmp/xap_String_Id.h.h:898 -msgid "identical" -msgstr "" - -#. DLG_Unit_inch -#: po/tmp/xap_String_Id.h.h:900 -msgid "inch" -msgstr "" - -#. DLG_Unit_mm -#: po/tmp/xap_String_Id.h.h:902 -msgid "mm" -msgstr "" - -#. DLG_Unit_pica -#: po/tmp/xap_String_Id.h.h:904 -msgid "pica" -msgstr "" - -#. DLG_Unit_points -#: po/tmp/xap_String_Id.h.h:906 -msgid "points" -msgstr "" - -#. DLG_DocComparison_Siblings -#: po/tmp/xap_String_Id.h.h:908 -msgid "siblings" -msgstr "" - -#. DLG_DocComparison_Unrelated -#: po/tmp/xap_String_Id.h.h:910 -msgid "unrelated" -msgstr "" diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/po/pt-BR.po /tmp/qY2gb79Nml/abiword-2.6.4/abiword/po/pt-BR.po --- abiword-2.6.2/abiword/po/pt-BR.po 2008-04-06 17:00:52.000000000 +0100 +++ abiword-2.6.4/abiword/po/pt-BR.po 2008-07-13 14:10:52.000000000 +0100 @@ -1,5 +1,4 @@ -# translation of pt-BR.po to Portugus do Brasil -# Translation of Abiword to Brazilian Portuguese +# Translation of Abiword to Brazilian Portuguese. # Copyright (C) 2003, 2004 Free Software Foundation, Inc. # Nelson Ferraz , 2004. # @@ -39,7 +38,7 @@ #. MENU_STATUSLINE_HELP #: po/tmp/ap_String_Id.h.h:23 msgid " " -msgstr "Fechar documento" +msgstr " " #. DLG_Styles_ErrNotTitle2 #: po/tmp/ap_String_Id.h.h:25 @@ -47,7 +46,7 @@ " - Reserved. \n" " You cannot use this name. Choose Another \n" msgstr "" -"Reservado. \n" +" - Reservado. \n" " No pode usar este nome. Escolha outro \n" #. DLG_WordCount_Auto_Update @@ -327,7 +326,7 @@ #. MENU_LABEL_FMT_STYLE_DEFINE #: po/tmp/ap_String_Id.h.h:139 msgid "&Create and Modify Styles" -msgstr "&Criar e Modificar" +msgstr "&Criar e Modificar Estilos" #. DLG_Options_Label_PrefsCurrentScheme #: po/tmp/ap_String_Id.h.h:141 @@ -2148,9 +2147,8 @@ #. MENU_LABEL_EDIT_CUTEMBED #: po/tmp/ap_String_Id.h.h:873 -#, fuzzy msgid "Cut Object" -msgstr "Definir" +msgstr "Remover Objeto" #. MENU_LABEL_EDIT_CUT_FRAME #: po/tmp/ap_String_Id.h.h:875 @@ -2287,9 +2285,8 @@ #. MENU_LABEL_EDIT_DELETEEMBED #: po/tmp/ap_String_Id.h.h:931 -#, fuzzy msgid "Delete Object" -msgstr "Apagar &Tabela" +msgstr "Apagar Objeto" #. MENU_LABEL_TABLE_DELETEROW #: po/tmp/ap_String_Id.h.h:933 @@ -2926,9 +2923,8 @@ #. MENU_LABEL_FMT_EMBED #: po/tmp/ap_String_Id.h.h:1192 -#, fuzzy msgid "Format Object" -msgstr "Formatar Tabela" +msgstr "Formatar Objeto" #. TOOLBAR_LABEL_FMTPAINTER #: po/tmp/ap_String_Id.h.h:1194 Binary files /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/po/zh-CN.po and /tmp/qY2gb79Nml/abiword-2.6.4/abiword/po/zh-CN.po differ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/unix/ev_UnixMenu.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/unix/ev_UnixMenu.cpp --- abiword-2.6.2/abiword/src/af/ev/unix/ev_UnixMenu.cpp 2008-04-06 17:00:00.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/unix/ev_UnixMenu.cpp 2008-07-13 14:09:48.000000000 +0100 @@ -85,7 +85,7 @@ // map the user_data into an object and dispatch the event. _wd * wd = static_cast<_wd *>(callback_data); - UT_ASSERT(wd); + UT_return_if_fail(wd); wd->m_pUnixMenu->menuEvent(wd->m_id); } @@ -95,11 +95,11 @@ UT_ASSERT(widget && data); _wd * wd = static_cast<_wd *>(data); - UT_ASSERT(wd && wd->m_pUnixMenu); + UT_return_if_fail(wd && wd->m_pUnixMenu); // WL_REFACTOR: redundant code XAP_Frame * pFrame = wd->m_pUnixMenu->getFrame(); - UT_ASSERT(pFrame); + UT_return_if_fail(pFrame); EV_Menu_Label * pLabel = wd->m_pUnixMenu->getLabelSet()->getLabel(wd->m_id); if (!pLabel) { @@ -118,10 +118,10 @@ UT_ASSERT(widget && data); _wd * wd = static_cast<_wd *>(data); - UT_ASSERT(wd && wd->m_pUnixMenu); + UT_return_if_fail(wd && wd->m_pUnixMenu); XAP_Frame * pFrame = wd->m_pUnixMenu->getFrame(); - UT_ASSERT(pFrame); + UT_return_if_fail(pFrame); pFrame->setStatusMessage(NULL); } @@ -129,19 +129,19 @@ static void s_onInitMenu(GtkMenuItem * menuItem, gpointer callback_data) { _wd * wd = static_cast<_wd *>(callback_data); - UT_ASSERT(wd); + UT_return_if_fail(wd); wd->m_pUnixMenu->refreshMenu(wd->m_pUnixMenu->getFrame()->getCurrentView()); } static void s_onDestroyMenu(GtkMenuItem * menuItem, gpointer callback_data) { _wd * wd = static_cast<_wd *>(callback_data); - UT_ASSERT(wd); + UT_return_if_fail(wd); // we always clear the status bar when a menu goes away, so we don't // leave a message behind XAP_Frame * pFrame = wd->m_pUnixMenu->getFrame(); - UT_ASSERT(pFrame); + UT_return_if_fail(pFrame); pFrame->setStatusMessage(NULL); } @@ -315,17 +315,17 @@ // return true if handled. const EV_Menu_ActionSet * pMenuActionSet = m_pUnixApp->getMenuActionSet(); - UT_ASSERT(pMenuActionSet); + UT_return_val_if_fail(pMenuActionSet, false); const EV_Menu_Action * pAction = pMenuActionSet->getAction(id); - UT_ASSERT(pAction); + UT_return_val_if_fail(pAction, false); const char * szMethodName = pAction->getMethodName(); if (!szMethodName) return false; const EV_EditMethodContainer * pEMC = m_pUnixApp->getEditMethodContainer(); - UT_ASSERT(pEMC); + UT_return_val_if_fail(pEMC, false); EV_EditMethod * pEM = pEMC->findEditMethodByName(szMethodName); UT_ASSERT(pEM); // make sure it's bound to something @@ -420,7 +420,7 @@ for (UT_uint32 k = 0; (k < nrLabelItemsInLayout); k++) { EV_Menu_LayoutItem * pLayoutItem = m_pMenuLayout->getLayoutItem(k); - UT_ASSERT(pLayoutItem); + UT_continue_if_fail(pLayoutItem); XAP_Menu_Id id = pLayoutItem->getMenuId(); // VERY BAD HACK! It will be here until I fix the const correctness of all the functions diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/unix/ev_UnixToolbar.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/unix/ev_UnixToolbar.cpp --- abiword-2.6.2/abiword/src/af/ev/unix/ev_UnixToolbar.cpp 2008-04-06 17:00:00.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/unix/ev_UnixToolbar.cpp 2008-07-13 14:09:48.000000000 +0100 @@ -332,7 +332,7 @@ // map the user_data into an object and dispatch the event. _wd * wd = static_cast<_wd *>(user_data); - UT_ASSERT(wd); + UT_return_if_fail(wd); GdkEvent * event = gtk_get_current_event(); wd->m_pUnixToolbar->setCurrentEvent(event); if (!wd->m_blockSignal) @@ -347,7 +347,7 @@ // map the user_data into an object and dispatch the event. _wd * wd = reinterpret_cast<_wd *>(user_data); - UT_ASSERT(wd); + UT_return_if_fail(wd); GdkEvent * event = gtk_get_current_event(); wd->m_pUnixToolbar->setCurrentEvent(event); if (!wd->m_blockSignal && (rows > 0) && (cols > 0)) @@ -456,7 +456,7 @@ static void s_combo_changed(GtkComboBox * combo, _wd * wd) { - UT_ASSERT(wd); + UT_return_if_fail(wd); // only act if the widget has been shown and embedded in the toolbar if (!wd->m_widget || wd->m_blockSignal) { @@ -555,7 +555,7 @@ const gchar * editMethod = gtk_action_get_name(action); XAP_UnixApp * pUnixApp = wd->m_pUnixToolbar->getApp(); const EV_EditMethodContainer * pEMC = pUnixApp->getEditMethodContainer(); - UT_ASSERT(pEMC); + UT_return_if_fail(pEMC); EV_EditMethod * pEM = NULL; AV_View * pView = wd->m_pUnixToolbar->getFrame()->getCurrentView(); @@ -605,7 +605,7 @@ XAP_Toolbar_Id id = wd->m_id; const EV_Toolbar_ActionSet * pToolbarActionSet = m_pUnixApp->getToolbarActionSet(); - UT_ASSERT(pToolbarActionSet); + UT_return_val_if_fail(pToolbarActionSet, false); const EV_Toolbar_Action * pAction = pToolbarActionSet->getAction(id); UT_ASSERT(pAction); @@ -642,7 +642,7 @@ return false; const EV_EditMethodContainer * pEMC = m_pUnixApp->getEditMethodContainer(); - UT_ASSERT(pEMC); + UT_return_val_if_fail(pEMC, false); EV_EditMethod * pEM = pEMC->findEditMethodByName(szMethodName); UT_ASSERT(pEM); // make sure it's bound to something @@ -802,7 +802,7 @@ for (UT_uint32 k=0; (k < nrLabelItemsInLayout); k++) { EV_Toolbar_LayoutItem * pLayoutItem = m_pToolbarLayout->getLayoutItem(k); - UT_ASSERT(pLayoutItem); + UT_continue_if_fail(pLayoutItem); XAP_Toolbar_Id id = pLayoutItem->getToolbarId(); EV_Toolbar_Action * pAction = pToolbarActionSet->getAction(id); @@ -1204,11 +1204,11 @@ for (UT_uint32 k=0; (k < nrLabelItemsInLayout); k++) { EV_Toolbar_LayoutItem * pLayoutItem = m_pToolbarLayout->getLayoutItem(k); - UT_ASSERT(pLayoutItem); + UT_continue_if_fail(pLayoutItem); XAP_Toolbar_Id id = pLayoutItem->getToolbarId(); EV_Toolbar_Action * pAction = pToolbarActionSet->getAction(id); - UT_ASSERT(pAction); + UT_continue_if_fail(pAction); AV_ChangeMask maskOfInterest = pAction->getChangeMaskOfInterest(); if ((maskOfInterest & mask) == 0) // if this item doesn't care about @@ -1436,7 +1436,7 @@ // UT_ASSERT(wd->m_id == AP_TOOLBAR_ID_FMT_STYLE); XAP_Toolbar_ControlFactory * pFactory = m_pUnixApp->getControlFactory(); - UT_ASSERT(pFactory); + UT_return_val_if_fail(pFactory, false); EV_Toolbar_Control * pControl = pFactory->getControl(this, id); AP_UnixToolbar_StyleCombo * pStyleC = static_cast(pControl); pStyleC->repopulate(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Keyboard.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Keyboard.h --- abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Keyboard.h 2008-04-06 17:00:04.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Keyboard.h 2008-07-13 14:09:50.000000000 +0100 @@ -27,7 +27,7 @@ class AV_View; -class ev_Win32Keyboard : public EV_Keyboard +class ABI_EXPORT ev_Win32Keyboard : public EV_Keyboard { public: ev_Win32Keyboard(EV_EditEventMapper * pEEM); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Menu.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Menu.h --- abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Menu.h 2008-04-06 17:00:04.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Menu.h 2008-07-13 14:09:50.000000000 +0100 @@ -42,7 +42,7 @@ } EV_Menu_Bitmap; -class EV_Win32Menu : public EV_Menu +class ABI_EXPORT EV_Win32Menu : public EV_Menu { public: EV_Win32Menu(XAP_Win32App * pWin32App, @@ -98,7 +98,7 @@ /*****************************************************************/ -class EV_Win32MenuBar : public EV_Win32Menu +class ABI_EXPORT EV_Win32MenuBar : public EV_Win32Menu { public: EV_Win32MenuBar(XAP_Win32App * pWin32App, @@ -112,7 +112,7 @@ /*****************************************************************/ -class EV_Win32MenuPopup : public EV_Win32Menu +class ABI_EXPORT EV_Win32MenuPopup : public EV_Win32Menu { public: EV_Win32MenuPopup(XAP_Win32App * pWin32App, diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Mouse.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Mouse.h --- abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Mouse.h 2008-04-06 17:00:04.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Mouse.h 2008-07-13 14:09:50.000000000 +0100 @@ -34,7 +34,7 @@ class AV_View; -class EV_Win32Mouse : public EV_Mouse +class ABI_EXPORT EV_Win32Mouse : public EV_Mouse { public: EV_Win32Mouse(EV_EditEventMapper * pEEM); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Toolbar.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Toolbar.cpp --- abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Toolbar.cpp 2008-04-06 17:00:03.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Toolbar.cpp 2008-07-13 14:09:50.000000000 +0100 @@ -74,7 +74,7 @@ // This one should really be in the anonymous namespace in this translation // unit, but since we don't use namespaces... // -class foo_Bitmap_container +class ABI_EXPORT foo_Bitmap_container { public: // d'tor needs to be public due to buggy MSVC compilers ~foo_Bitmap_container(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Toolbar.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Toolbar.h --- abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Toolbar.h 2008-04-06 17:00:04.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Toolbar.h 2008-07-13 14:09:50.000000000 +0100 @@ -45,7 +45,7 @@ #define _ev_MENU_OFFSET 1000 #endif -class EV_Win32Toolbar : public EV_Toolbar +class ABI_EXPORT EV_Win32Toolbar : public EV_Toolbar { public: EV_Win32Toolbar(XAP_Win32App * pWin32App, XAP_Frame * pFrame, diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Toolbar_ViewListener.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Toolbar_ViewListener.h --- abiword-2.6.2/abiword/src/af/ev/win/ev_Win32Toolbar_ViewListener.h 2008-04-06 17:00:04.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/win/ev_Win32Toolbar_ViewListener.h 2008-07-13 14:09:50.000000000 +0100 @@ -25,7 +25,7 @@ class AV_View; -class EV_Win32Toolbar_ViewListener : public AV_Listener +class ABI_EXPORT EV_Win32Toolbar_ViewListener : public AV_Listener { public: EV_Win32Toolbar_ViewListener(EV_Win32Toolbar * pWin32Toolbar, diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/xp/ev_EditBinding.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/xp/ev_EditBinding.cpp --- abiword-2.6.2/abiword/src/af/ev/xp/ev_EditBinding.cpp 2008-04-06 17:00:02.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/xp/ev_EditBinding.cpp 2008-07-13 14:09:50.000000000 +0100 @@ -63,7 +63,7 @@ /*****************************************************************/ /*****************************************************************/ -class ev_EB_MouseTable +class ABI_EXPORT ev_EB_MouseTable { public: ev_EB_MouseTable() @@ -88,7 +88,7 @@ EV_EditBinding * m_peb[EV_COUNT_EMO][EV_COUNT_EMS][EV_COUNT_EMC]; }; -class ev_EB_NVK_Table +class ABI_EXPORT ev_EB_NVK_Table { public: ev_EB_NVK_Table() @@ -110,7 +110,7 @@ EV_EditBinding * m_peb[EV_COUNT_NVK][EV_COUNT_EMS]; }; -class ev_EB_Char_Table +class ABI_EXPORT ev_EB_Char_Table { public: ev_EB_Char_Table() diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/xp/ev_EditMethod.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/xp/ev_EditMethod.cpp --- abiword-2.6.2/abiword/src/af/ev/xp/ev_EditMethod.cpp 2008-04-06 17:00:02.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/xp/ev_EditMethod.cpp 2008-07-13 14:09:50.000000000 +0100 @@ -282,9 +282,7 @@ return pEM->Fn(pView, pData); } pView = pFrame->getCurrentView() ; - UT_ASSERT(pView); - if (!pView) - return false; + UT_return_val_if_fail(pView, false); // return whatever the method says to based on the data at hand return pEM->Fn(pView, pData); @@ -314,17 +312,13 @@ bool ev_EditMethod_invoke (const char * methodName, const char * data) { - UT_ASSERT(data); - if(!data) - return false; + UT_return_val_if_fail(data, false); return ev_EditMethod_invoke ( methodName, UT_String(data) ) ; } bool ev_EditMethod_invoke (const char * methodName, const UT_UCSChar * data) { - UT_ASSERT(data); - if(!data) - return false; + UT_return_val_if_fail(data, false); return ev_EditMethod_invoke ( methodName, UT_UCS4String(data) ) ; } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/xp/ev_Menu.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/xp/ev_Menu.cpp --- abiword-2.6.2/abiword/src/af/ev/xp/ev_Menu.cpp 2008-04-06 17:00:02.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/xp/ev_Menu.cpp 2008-07-13 14:09:50.000000000 +0100 @@ -150,7 +150,7 @@ UT_uint32 dataLength) { UT_ASSERT(pView); - UT_ASSERT(pEM); + UT_return_val_if_fail(pEM, false); //UT_DEBUGMSG(("invokeMenuMethod: %s\n",pEM->getName())); @@ -221,13 +221,13 @@ if (szMethodName) { const EV_EditMethodContainer * pEMC = pApp->getEditMethodContainer(); - UT_ASSERT(pEMC); + UT_return_val_if_fail(pEMC, NULL); EV_EditMethod * pEM = pEMC->findEditMethodByName(szMethodName); UT_ASSERT(pEM); // make sure it's bound to something const EV_EditEventMapper * pEEM = getApp()->getEditEventMapper(); - UT_ASSERT(pEEM); + UT_return_val_if_fail(pEEM, NULL); const char * string = pEEM->getShortcutFor(pEM); if (string && *string) @@ -266,7 +266,7 @@ const UT_GenericVector * labels_table = labels->getAllLabels(); const EV_Menu_Label *l = 0; - UT_ASSERT(labels_table); + UT_return_val_if_fail(labels_table, 0); UT_uint32 size_labels = labels_table->size(); XAP_Menu_Id id = 0; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/ev/xp/ev_Toolbar.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/ev/xp/ev_Toolbar.cpp --- abiword-2.6.2/abiword/src/af/ev/xp/ev_Toolbar.cpp 2008-04-06 17:00:03.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/ev/xp/ev_Toolbar.cpp 2008-07-13 14:09:50.000000000 +0100 @@ -74,7 +74,7 @@ UT_uint32 dataLength) { UT_ASSERT(pView); - UT_ASSERT(pEM); + UT_return_val_if_fail(pEM, false); //UT_DEBUGMSG(("invokeToolbarMethod: %s\n",pEM->getName())); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixImage.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixImage.h --- abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixImage.h 2008-04-06 16:59:45.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixImage.h 2008-07-13 14:09:30.000000000 +0100 @@ -24,7 +24,7 @@ #include "gr_Image.h" -class GR_UnixImage : public GR_RasterImage +class ABI_EXPORT GR_UnixImage : public GR_RasterImage { friend class GR_UnixPangoGraphics; public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixNullGraphics.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixNullGraphics.h --- abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixNullGraphics.h 2008-04-06 16:59:45.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixNullGraphics.h 2008-07-13 14:09:31.000000000 +0100 @@ -29,7 +29,7 @@ /*****************************************************************/ /*****************************************************************/ -class GR_UnixNullGraphicsAllocInfo : public GR_AllocInfo +class ABI_EXPORT GR_UnixNullGraphicsAllocInfo : public GR_AllocInfo { public: GR_UnixNullGraphicsAllocInfo() diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixPangoGraphics.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixPangoGraphics.cpp --- abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixPangoGraphics.cpp 2008-04-06 16:59:45.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixPangoGraphics.cpp 2008-07-13 14:09:30.000000000 +0100 @@ -137,6 +137,7 @@ GR_UnixPangoRenderInfo(GR_ScriptType t): GR_RenderInfo(t), m_pGlyphs(NULL), + m_pScaledGlyphs(NULL), m_pLogOffsets(NULL), m_pJustify(NULL), m_iZoom(0), @@ -153,6 +154,8 @@ delete [] m_pJustify; delete [] m_pLogOffsets; if(m_pGlyphs) pango_glyph_string_free(m_pGlyphs); + if(m_pScaledGlyphs) + pango_glyph_string_free(m_pScaledGlyphs); s_iInstanceCount--; if(!s_iInstanceCount) @@ -187,6 +190,7 @@ } PangoGlyphString* m_pGlyphs; + PangoGlyphString* m_pScaledGlyphs; int * m_pLogOffsets; int * m_pJustify; UT_uint32 m_iZoom; @@ -237,10 +241,13 @@ : m_pFontMap(NULL), m_pContext(NULL), + m_pLayoutFontMap(NULL), + m_pLayoutContext(NULL), m_bOwnsFontMap(false), m_pPFont(NULL), m_pPFontGUI(NULL), m_pAdjustedPangoFont(NULL), + m_pAdjustedLayoutPangoFont(NULL), m_pAdjustedPangoFontSource(NULL), m_iAdjustedPangoFontZoom (0), m_iDeviceResolution(96), @@ -262,10 +269,13 @@ : m_pFontMap(NULL), m_pContext(NULL), + m_pLayoutFontMap(NULL), + m_pLayoutContext(NULL), m_bOwnsFontMap(false), m_pPFont(NULL), m_pPFontGUI(NULL), m_pAdjustedPangoFont(NULL), + m_pAdjustedLayoutPangoFont(NULL), m_pAdjustedPangoFontSource(NULL), m_iAdjustedPangoFontZoom (0), m_iDeviceResolution(96), @@ -289,6 +299,10 @@ { g_object_unref(m_pAdjustedPangoFont); } + if(m_pAdjustedLayoutPangoFont!= NULL) + { + g_object_unref(m_pAdjustedLayoutPangoFont); + } if (m_pContext != NULL) { g_object_unref(m_pContext); @@ -299,6 +313,8 @@ _destroyFonts(); delete m_pPFontGUI; + g_object_unref(m_pLayoutFontMap); + g_object_unref(m_pLayoutContext); if (m_pXftDraw) g_free(m_pXftDraw); @@ -455,7 +471,7 @@ #ifdef HAVE_PANGOFT2 else { - m_iDeviceResolution = 72; + m_iDeviceResolution = 72.; m_pFontMap = pango_ft2_font_map_new (); pango_ft2_font_map_set_resolution(reinterpret_cast(m_pFontMap), m_iDeviceResolution, @@ -463,6 +479,11 @@ m_pContext = pango_ft2_font_map_create_context(reinterpret_cast(m_pFontMap)); m_bOwnsFontMap = true; } + m_pLayoutFontMap = pango_ft2_font_map_new (); + pango_ft2_font_map_set_resolution(reinterpret_cast(m_pLayoutFontMap), + getResolution(), + getResolution()); + m_pLayoutContext = pango_ft2_font_map_create_context(reinterpret_cast(m_pLayoutFontMap)); #endif } @@ -1057,7 +1078,14 @@ RI->m_pGlyphs = NULL; } + if(RI->m_pScaledGlyphs) + { + pango_glyph_string_free(RI->m_pScaledGlyphs); + RI->m_pScaledGlyphs = NULL; + } + RI->m_pGlyphs = pango_glyph_string_new(); + RI->m_pScaledGlyphs = pango_glyph_string_new(); /* * We want to do the shaping on a font at it's actual point size, so we @@ -1094,7 +1122,7 @@ } UT_return_val_if_fail(pfd, false); - PangoFont * pf = pango_context_load_font(getContext(), pfd); + PangoFont * pf = pango_context_load_font(getLayoutContext(), pfd); pango_font_description_free(pfd); pItem->m_pi->analysis.font = pf; @@ -1104,6 +1132,8 @@ pango_shape(utf8.utf8_str(), utf8.byteLength(), &(pItem->m_pi->analysis), RI->m_pGlyphs); + pango_shape(utf8.utf8_str(), utf8.byteLength(), + &(pItem->m_pi->analysis), RI->m_pScaledGlyphs); if (pPangoFontOrig) pItem->m_pi->analysis.font = pPangoFontOrig; @@ -1147,7 +1177,13 @@ GR_UnixPangoFont * pFont = (GR_UnixPangoFont *) RI.m_pFont; UT_return_val_if_fail( pFont, 0 ); - PangoFont * pf = _adjustedPangoFont(pFont, pItem->m_pi->analysis.font); + // + // Actually want the layout font here + // + PangoFont * pf = _adjustedLayoutPangoFont(pFont, pItem->m_pi->analysis.font); + PangoFont * pfa = _adjustedPangoFont(pFont, pItem->m_pi->analysis.font); + + xxx_UT_DEBUGMSG(("Adjusted Layout font %x Adjusted font %x \n",pf,pfa)); UT_return_val_if_fail( pf, 0 ); UT_sint32 iStart = RI.m_iOffset; @@ -1233,7 +1269,11 @@ } UT_ASSERT_HARMLESS( iOffsetStart >= 0 ); - + + PangoFontDescription * pfd = pango_font_describe (pf); + int isize = pango_font_description_get_size(pfd); + xxx_UT_DEBUGMSG(("Font size in _measureExtents %d \n",isize)); + if(iOffsetEnd < 0 && iDir == UT_BIDI_LTR) { // to the end @@ -1258,7 +1298,7 @@ xxx_UT_DEBUGMSG(("::getTextWidth start %d, end %d, w %d, x %d\n", iOffsetStart, iOffsetEnd, LR.width, LR.x)); - return ptlu(LR.width + LR.x); + return ptlunz(LR.width + LR.x); } @@ -1283,7 +1323,7 @@ } /* - * This is used to get PangoFont that is correct for present zoom level. + * This is used to get device zoomed PangoFont that is correct for present zoom level. * pFont is the font that we are supposed to be using (the user-selected font) * pf is the PangoFont that we are actually using (possibly a different, * substituted font). @@ -1310,23 +1350,87 @@ PangoFontDescription * pfd = pango_font_describe (pf); double dSize = pFont->getPointSize (); + + /* We cache this font to avoid all this huha if we can */ + if (m_pAdjustedLayoutPangoFont) + { + g_object_unref(m_pAdjustedLayoutPangoFont); + } + if (m_pAdjustedPangoFont) + { + g_object_unref(m_pAdjustedPangoFont); + } + pango_font_description_set_size (pfd, (gint)dSize * PANGO_SCALE); + m_pAdjustedLayoutPangoFont = pango_context_load_font(getLayoutContext(), pfd); + m_pAdjustedPangoFontSource = pFont; + dSize = (gint)(dSize*(double)PANGO_SCALE *(double)getZoomPercentage() / 100.0); + pango_font_description_set_size (pfd, (gint)dSize); + m_pAdjustedPangoFont = pango_context_load_font(getContext(), pfd); + m_iAdjustedPangoFontZoom = getZoomPercentage(); + + pango_font_description_free(pfd); + + return m_pAdjustedPangoFont; +} + + +/* + * This is used to get Layout PangoFont that is correct for present zoom level. + * pFont is the font that we are supposed to be using (the user-selected font) + * pf is the PangoFont that we are actually using (possibly a different, + * substituted font). + */ +PangoFont * GR_UnixPangoGraphics::_adjustedLayoutPangoFont (GR_UnixPangoFont * pFont, PangoFont * pf) +{ + UT_return_val_if_fail(pFont, NULL); + if (!pf) + { + xxx_UT_DEBUGMSG(("Getting Layout font \n")); + return pFont->getPangoLayoutFont(); + } + /* See if this is not the font we have currently cached */ + if (pFont == m_pAdjustedPangoFontSource && + m_iAdjustedPangoFontZoom == getZoomPercentage()) + { + return m_pAdjustedLayoutPangoFont; + } + + /* + * When Pango is doing font substitution for us, the substitute font + * we are getting always has size 12pt, so we have to use the size of + * our own font to fix this. + */ + PangoFontDescription * pfd = pango_font_describe (pf); + + double dSize = pFont->getPointSize()*(double)PANGO_SCALE; + + xxx_UT_DEBUGMSG(("Setting adjustedLayout point size %f \n",dSize)); pango_font_description_set_size (pfd, (gint)dSize); /* We cache this font to avoid all this huha if we can */ - if (m_pAdjustedPangoFont) + if (m_pAdjustedLayoutPangoFont) + { + g_object_unref(m_pAdjustedLayoutPangoFont); + } + if (m_pAdjustedPangoFont ) { g_object_unref(m_pAdjustedPangoFont); } - m_pAdjustedPangoFont = pango_context_load_font(getContext(), pfd); + m_pAdjustedLayoutPangoFont = pango_context_load_font(getLayoutContext(), pfd); m_pAdjustedPangoFontSource = pFont; + + dSize = + (gint)(dSize* (double)getZoomPercentage() / 100.0); + pango_font_description_set_size (pfd, (gint)dSize); + m_pAdjustedPangoFont = pango_context_load_font(getContext(), pfd); m_iAdjustedPangoFontZoom = getZoomPercentage(); pango_font_description_free(pfd); - return m_pAdjustedPangoFont; + return m_pAdjustedLayoutPangoFont; } @@ -1346,6 +1450,9 @@ if(RI.m_iLength == 0) return; + // + // Actually want the zoomed device font here + // PangoFont * pf = _adjustedPangoFont(pFont, pItem->m_pi->analysis.font); xxx_UT_DEBUGMSG(("Pango renderChars: xoff %d yoff %d\n", @@ -1354,14 +1461,15 @@ UT_sint32 xoff = _tduX(RI.m_xoff); UT_sint32 yoff = _tduY(RI.m_yoff + getFontAscent(pFont)); - UT_return_if_fail(m_pXftDraw && RI.m_pGlyphs); + UT_return_if_fail(m_pXftDraw && RI.m_pScaledGlyphs); // TODO -- test here for the endpoint as well if(RI.m_iOffset == 0 && (RI.m_iLength == (UT_sint32)RI.m_iCharCount || !RI.m_iCharCount)) { + xxx_UT_DEBUGMSG(("Doing XFT Render now.\n")); pango_xft_render(m_pXftDraw, &m_XftColor, pf, - RI.m_pGlyphs, xoff, yoff); + RI.m_pScaledGlyphs, xoff, yoff); } else { @@ -1386,7 +1494,7 @@ { // it seems the iterator run out on us // this should probably not happen - UT_DEBUGMSG(("gr_UnixPangoGraphics::renderChars: iterator too short\n")); + xxx_UT_DEBUGMSG(("gr_UnixPangoGraphics::renderChars: iterator too short\n")); return; } @@ -1415,12 +1523,12 @@ UT_sint32 iGlyphsEnd = -1; i = 0; - while(i < (UT_uint32)RI.m_pGlyphs->num_glyphs) + while(i < (UT_uint32)RI.m_pScaledGlyphs->num_glyphs) { - if(iGlyphsStart < 0 && RI.m_pGlyphs->log_clusters[i] == iOffsetStart) + if(iGlyphsStart < 0 && RI.m_pScaledGlyphs->log_clusters[i] == iOffsetStart) iGlyphsStart = i; - if(RI.m_pGlyphs->log_clusters[i] == iOffsetEnd) + if(RI.m_pScaledGlyphs->log_clusters[i] == iOffsetEnd) { iGlyphsEnd = i; break; @@ -1436,7 +1544,7 @@ iOffsetStart, iOffsetEnd)); gs.num_glyphs = iGlyphsEnd - iGlyphsStart + 1; // including the last glyph - gs.glyphs = RI.m_pGlyphs->glyphs + iGlyphsStart; + gs.glyphs = RI.m_pScaledGlyphs->glyphs + iGlyphsStart; gs.log_clusters = RI.m_pGlyphs->log_clusters + iGlyphsStart; pango_xft_render(m_pXftDraw, &m_XftColor, pf, @@ -1448,39 +1556,26 @@ void GR_UnixPangoGraphics::_scaleCharacterMetrics(GR_UnixPangoRenderInfo & RI) { UT_uint32 iZoom = getZoomPercentage(); - if(RI.m_iZoom == iZoom) - return; + xxx_UT_DEBUGMSG(("_scaleCharacterMetrics... \n")); for(int i = 0; i < RI.m_pGlyphs->num_glyphs; ++i) { - RI.m_pGlyphs->glyphs[i].geometry.x_offset = - (int)((double)RI.m_pGlyphs->glyphs[i].geometry.x_offset * - (double)iZoom / (double)RI.m_iZoom + 0.5) ; + RI.m_pScaledGlyphs->glyphs[i].geometry.x_offset = + _tduX(RI.m_pGlyphs->glyphs[i].geometry.x_offset); - RI.m_pGlyphs->glyphs[i].geometry.y_offset = - (int)((double)RI.m_pGlyphs->glyphs[i].geometry.y_offset * - (double)iZoom / (double)RI.m_iZoom + 0.5); - RI.m_pGlyphs->glyphs[i].geometry.width = - (int)((double)RI.m_pGlyphs->glyphs[i].geometry.width * - (double)iZoom / (double)RI.m_iZoom + 0.5); - } + RI.m_pScaledGlyphs->glyphs[i].geometry.y_offset = _tduY(RI.m_pGlyphs->glyphs[i].geometry.y_offset); + RI.m_pScaledGlyphs->glyphs[i].geometry.width =_tduX(RI.m_pGlyphs->glyphs[i].geometry.width ); + } RI.m_iZoom = iZoom; } void GR_UnixPangoGraphics::_scaleJustification(GR_UnixPangoRenderInfo & RI) { - UT_uint32 iZoom = getZoomPercentage(); - if(RI.m_iZoom == iZoom) - return; - - for(int i = 0; i < RI.m_pGlyphs->num_glyphs; ++i) - { - RI.m_pJustify[i] = - (int)((double)RI.m_pJustify[i] * (double)iZoom / (double)RI.m_iZoom + 0.5) ; - } + RI.m_iZoom = getZoomPercentage(); + return; } @@ -1683,7 +1778,10 @@ // but in both cases we will let the delete proceed as is } - +/*! + * I believe this code clears all the justification points. MES June 2008 + * It returns the total space assigned to justify the text in layout units. + */ UT_sint32 GR_UnixPangoGraphics::resetJustification(GR_RenderInfo & ri, bool bPermanent) { @@ -1693,8 +1791,6 @@ if(!RI.m_pJustify) return 0; - if(RI.m_iZoom != getZoomPercentage()) - _scaleCharacterMetrics(RI); UT_sint32 iWidth2 = 0; for(UT_sint32 i = 0; i < RI.m_pGlyphs->num_glyphs; ++i) @@ -1704,6 +1800,10 @@ // TODO here we need to substract the amount from pango metrics RI.m_pGlyphs->glyphs[i].geometry.width -= RI.m_pJustify[i]; } + // + // This sets the glyphs that will be displayed on screen. + // + _scaleCharacterMetrics(RI); if(bPermanent) { @@ -1715,7 +1815,9 @@ memset(RI.m_pJustify, 0, RI.m_pGlyphs->num_glyphs * sizeof(int)); } - return ptlu(-iWidth2); + // Justification in pango units. Convert to layout units. + + return -ptlunz(iWidth2); } @@ -1766,6 +1868,10 @@ We take the same approach as with Uniscribe; we store the justification amount in a separate array of the ri and add it to the offsets before we draw. We will probably need some static buffers to speed things up + +It requires as input RI.m_iJustificationAmount and RI.m_iJustificationPoints. +These are determined in fp_TextRun using calculations in layout units + */ void GR_UnixPangoGraphics::justify(GR_RenderInfo & ri) { @@ -1776,8 +1882,9 @@ return; // make sure that we are not adding apples to oranges - if(RI.m_iZoom != getZoomPercentage()) - _scaleCharacterMetrics(RI); + // We don't need this now. + // if(RI.m_iZoom != getZoomPercentage()) + // _scaleCharacterMetrics(RI); if(!RI.m_pJustify) RI.m_pJustify = new int[RI.m_pGlyphs->num_glyphs]; @@ -1788,6 +1895,9 @@ UT_uint32 iExtraSpace = RI.m_iJustificationAmount; UT_uint32 iPoints = RI.m_iJustificationPoints; + xxx_UT_DEBUGMSG(("::Justify Extra justification space %d \n",iExtraSpace)); + xxx_UT_DEBUGMSG(("::Justify Number of justification points %d \n",iPoints)); + UT_return_if_fail(RI.m_pText); UT_TextIterator & text = *RI.m_pText; @@ -1801,6 +1911,8 @@ UT_sint32 i; // glyph index UT_sint32 j; // text index + + UT_uint32 iSpace = iExtraSpace/iPoints; if (iDir == UT_BIDI_LTR) { @@ -1816,13 +1928,16 @@ if(c == UCS_SPACE) { - UT_uint32 iSpace = iExtraSpace/iPoints; - iExtraSpace -= iSpace; + + // iSpace is in layout units. Convert to pango units + + RI.m_pJustify[i] = ltpunz(iSpace); + iPoints--; - RI.m_pJustify[i] = ltpu(iSpace); + // add this amount the pango units + xxx_UT_DEBUGMSG(("Justify-1 Prev geom width %d additional %d \n",RI.m_pGlyphs->glyphs[i].geometry.width,RI.m_pJustify[i])); - // add this amount the pango metrics RI.m_pGlyphs->glyphs[i].geometry.width += RI.m_pJustify[i]; if(!iPoints) @@ -1863,13 +1978,15 @@ if(c == UCS_SPACE) { - UT_uint32 iSpace = iExtraSpace/iPoints; - iExtraSpace -= iSpace; iPoints--; - RI.m_pJustify[i] = ltpu(iSpace); + // iSpace is in layout units. Convert to pango units + + RI.m_pJustify[i] = ltpunz(iSpace); // add this amount the pango metrics + + xxx_UT_DEBUGMSG(("Justify-2 Prev geom width %d additional %d \n",RI.m_pGlyphs->glyphs[i].geometry.width,RI.m_pJustify[i])); RI.m_pGlyphs->glyphs[i].geometry.width += RI.m_pJustify[i]; if(!iPoints) @@ -1896,10 +2013,16 @@ j += iDiff; } } - - UT_ASSERT_HARMLESS( !iExtraSpace ); + // + // Now scale the metrics for the drawing glyphs + // + _scaleCharacterMetrics(RI); } +/*! + * This function takes (x,y) in layout units and determines the location in the + * pango string. + */ UT_uint32 GR_UnixPangoGraphics::XYToPosition(const GR_RenderInfo & ri, UT_sint32 x, UT_sint32 y) const { UT_return_val_if_fail(ri.getType() == GRRI_UNIX_PANGO, 0); @@ -1917,7 +2040,10 @@ utf8 += RI.m_pText->getChar(); } - int x_pos = ltpu(x); + // Since the glyphs are measured in pango units + // we need to convert from layout units + + int x_pos = ltpunz(x); int len = utf8.byteLength(); int iPos = len; int iTrailing; @@ -1949,6 +2075,9 @@ return i; } +/*! + * Return a location in layout units (x,y) of a pango glyph. + */ void GR_UnixPangoGraphics::positionToXY(const GR_RenderInfo & ri, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, @@ -2017,7 +2146,10 @@ bTrailing, &x); - x = ptlu(x); + // + // Since the glyphs are measured in pango units we need to convert to layout + // + x = ptlunz(x); x2 = x; } @@ -2083,6 +2215,14 @@ pItem->length, &(pItem->analysis), pGstring); + if(pCharWidth) + { + for(int j=0; jnum_glyphs; j++) + { + + pGstring->glyphs[j].geometry.width = _tduX(pCharWidth[j]*PANGO_SCALE); + } + } pango_xft_render(m_pXftDraw, &m_XftColor, pf, pGstring, xoffD, yoffD); // now advance xoff @@ -2127,14 +2267,14 @@ } // this function expect indexes in bytes !!! (stupid) - GList * pItems = pango_itemize(getContext(), + GList * pItems = pango_itemize(getLayoutContext(), utf8.utf8_str(), 0, utf8.byteLength(), NULL, NULL); PangoGlyphString * pGstring = pango_glyph_string_new(); - PangoFont * pf = m_pPFont->getPangoFont(); + PangoFont * pf = m_pPFont->getPangoLayoutFont(); PangoRectangle LR; UT_uint32 iOffset = 0; GList * l = pItems; @@ -2163,8 +2303,9 @@ pGstring); pango_glyph_string_extents(pGstring, pf, NULL, &LR); - iWidth += ptlu(LR.width + LR.x); - UT_uint32 h = ptlu(LR.height); + iWidth += ((double) LR.width + (double)LR.x)/PANGO_SCALE; + UT_uint32 h = LR.height/PANGO_SCALE; + xxx_UT_DEBUGMSG(("measure string iWidth %d height %d \n",iWidth,h)); if (height && *height < h) *height = h; @@ -3173,12 +3314,23 @@ */ inline int GR_UnixPangoGraphics::ptlu(int p) const { - double d = (double)p * 100.0 * (double) getResolution()/ + double d = (double)p * (double) getResolution() * 100.0 / ((double)getDeviceResolution()*(double)getZoomPercentage()*(double) PANGO_SCALE) + .5; return (int) d; } + +/*! + Convert pango units to layout units without zoom +*/ +inline int GR_UnixPangoGraphics::ptlunz(int p) const +{ + double d = ((double)p / ((double) PANGO_SCALE)) + .5; //getDeviceResolution + + return (int) d; +} + /*! Convert layout units to pango units */ @@ -3186,7 +3338,18 @@ { double d = (double)l * (double)getDeviceResolution() * (double)PANGO_SCALE * (double)getZoomPercentage()/ - ((double)getResolution() * 100.0) + .5; + (100.0 * (double) getResolution()) + .5; + + return (int) d; +} + + +/*! + Convert layout units to pango units without zoom +*/ +inline int GR_UnixPangoGraphics::ltpunz(int l) const +{ + double d = (double)l * PANGO_SCALE + .5; //getDeviceResolution() return (int) d; } @@ -3280,16 +3443,18 @@ m_pf(NULL), m_bGuiFont(bGuiFont), m_pCover(NULL), - m_pfd(NULL), + m_pfdDev(NULL), + m_pfdLay(NULL), m_pPLang(NULL), m_iAscent(0), - m_iDescent(0) + m_iDescent(0), + m_pLayoutF(NULL) { m_eType = GR_FONT_UNIX_PANGO; UT_return_if_fail( pDesc && pG && pLang); + m_sLayoutDesc = pDesc; m_sDesc = pDesc; - setLanguage(pLang); reloadFont(pG); } @@ -3302,7 +3467,12 @@ { g_object_unref(m_pf); } - pango_font_description_free(m_pfd); + if (m_pLayoutF) + { + g_object_unref(m_pLayoutF); + } + pango_font_description_free(m_pfdDev); + pango_font_description_free(m_pfdLay); } void GR_UnixPangoFont::setLanguage(const char * pLang) @@ -3327,37 +3497,57 @@ m_iZoom = iZoom; UT_LocaleTransactor t(LC_NUMERIC, "C"); - UT_String s; + UT_String sLay; + UT_String sDev; if(!m_bGuiFont && pG->queryProperties(GR_Graphics::DGP_SCREEN)) - UT_String_sprintf(s, "%s %f", m_sDesc.c_str(), m_dPointSize * (double)m_iZoom / 100.0); + { + UT_String_sprintf(sDev, "%s %f", m_sDesc.c_str(), m_dPointSize * (double)m_iZoom / 100.0); + UT_String_sprintf(sLay, "%s %f", m_sLayoutDesc.c_str(), m_dPointSize); + } else - UT_String_sprintf(s, "%s %f", m_sDesc.c_str(), m_dPointSize); - + { + UT_String_sprintf(sDev, "%s %f", m_sDesc.c_str(), m_dPointSize); + UT_String_sprintf(sLay, "%s %f", m_sLayoutDesc.c_str(), m_dPointSize); + } - if(m_pfd) + if(m_pfdLay) { - pango_font_description_free(m_pfd); - m_pfd = NULL; + pango_font_description_free(m_pfdLay); + m_pfdLay = NULL; + } + + + if(m_pfdDev) + { + pango_font_description_free(m_pfdDev); + m_pfdDev = NULL; } - m_pfd = pango_font_description_from_string(s.c_str()); - UT_return_if_fail(m_pfd); + m_pfdLay = pango_font_description_from_string(sLay.c_str()); + UT_return_if_fail(m_pfdLay); + + m_pfdDev = pango_font_description_from_string(sDev.c_str()); + UT_return_if_fail(m_pfdLay); if (m_pf) { g_object_unref(m_pf); } - m_pf = pango_context_load_font(pG->getContext(), m_pfd); + m_pf = pango_context_load_font(pG->getContext(), m_pfdDev); + m_pLayoutF = pango_context_load_font(pG->getLayoutContext(), m_pfdLay); UT_return_if_fail( m_pf ); + UT_return_if_fail( m_pLayoutF ); // FIXME: we probably want the real language from somewhere - PangoFontMetrics * pfm = pango_font_get_metrics(m_pf, m_pPLang); + PangoFontMetrics * pfm = pango_font_get_metrics(m_pLayoutF, m_pPLang); UT_return_if_fail( pfm); // pango_metrics_ functions return in points * PANGO_SCALE (points * 1024) - m_iAscent = (UT_uint32) pG->ptlu(pango_font_metrics_get_ascent(pfm)); - m_iDescent = (UT_uint32) pG->ptlu(pango_font_metrics_get_descent(pfm)); - xxx_UT_DEBUGMSG(("Font Ascent %d point size %f zoom %d \n",m_iAscent, m_dPointSize, m_iZoom)); + m_iAscent = (UT_uint32) pango_font_metrics_get_ascent(pfm)/PANGO_SCALE; + m_iDescent = (UT_uint32) pango_font_metrics_get_descent(pfm)/PANGO_SCALE; + xxx_UT_DEBUGMSG(("Layout Font Ascent %d point size %f zoom %d \n",m_iAscent, m_dPointSize, m_iZoom)); pango_font_metrics_unref(pfm); + + UT_return_if_fail( pfm); } @@ -3411,8 +3601,8 @@ { UT_return_val_if_fail( m_pf, false ); - guint iGlyphIndx = pango_fc_font_get_glyph (PANGO_FC_FONT(m_pf), g); - FT_Face pFace = pango_fc_font_lock_face(PANGO_FC_FONT(m_pf)); + guint iGlyphIndx = pango_fc_font_get_glyph (PANGO_FC_FONT(m_pLayoutF), g); + FT_Face pFace = pango_fc_font_lock_face(PANGO_FC_FONT(m_pLayoutF)); double resRatio = 1.0; @@ -3424,6 +3614,7 @@ if (pPGP) resRatio = pPGP->_getResolutionRatio(); + } #endif FT_Error error = FT_Load_Glyph(pFace, iGlyphIndx, @@ -3439,8 +3630,7 @@ return false; } - UT_uint32 iSize = (UT_uint32)(0.5 + m_dPointSize * resRatio *(double)pG->getResolution() / - (double)pG->getDeviceResolution()); + UT_uint32 iSize = (UT_uint32)(0.5 + m_dPointSize * resRatio *(double)pG->getResolution() / (double)pG->getDeviceResolution()); rec.left = static_cast(0.5 + fontPoints2float(iSize, pFace, pFace->glyph->metrics.horiBearingX)); @@ -3464,9 +3654,9 @@ const char* GR_UnixPangoFont::getFamily() const { - UT_return_val_if_fail( m_pfd, NULL ); + UT_return_val_if_fail( m_pfdLay, NULL ); - return pango_font_description_get_family(m_pfd); + return pango_font_description_get_family(m_pfdLay); } @@ -3646,12 +3836,6 @@ else { #ifdef HAVE_PANGOFT2 - // hardcode to something sane-ish. printing and unixnull graphics will use this - // fallback case - m_iScreenResolution = m_iDeviceResolution; - - m_pContext = pango_ft2_get_context(m_iScreenResolution, m_iScreenResolution); - m_pFontMap = pango_ft2_font_map_new (); m_bOwnsFontMap = true; #else UT_DEBUGMSG(("No screen, no display, and no PangoFT2. We're screwed.\n")); @@ -3745,32 +3929,32 @@ UT_uint32 GR_UnixPangoPrintGraphics::getFontAscent() { - return static_cast(static_cast(GR_UnixPangoGraphics::getFontAscent())*m_dResRatio); + return static_cast(static_cast(GR_UnixPangoGraphics::getFontAscent())); } UT_uint32 GR_UnixPangoPrintGraphics::getFontDescent() { - return static_cast(static_cast(GR_UnixPangoGraphics::getFontDescent())*m_dResRatio); + return static_cast(static_cast(GR_UnixPangoGraphics::getFontDescent())); } UT_uint32 GR_UnixPangoPrintGraphics::getFontHeight() { - return static_cast(static_cast(GR_UnixPangoGraphics::getFontHeight())*m_dResRatio); + return static_cast(static_cast(GR_UnixPangoGraphics::getFontHeight())); } UT_uint32 GR_UnixPangoPrintGraphics::getFontAscent(const GR_Font * fnt) { - return static_cast(static_cast(GR_UnixPangoGraphics::getFontAscent(fnt))*m_dResRatio); + return static_cast(static_cast(GR_UnixPangoGraphics::getFontAscent(fnt))); } UT_uint32 GR_UnixPangoPrintGraphics::getFontDescent(const GR_Font * fnt ) { - return static_cast(static_cast(GR_UnixPangoGraphics::getFontDescent(fnt))*m_dResRatio); + return static_cast(static_cast(GR_UnixPangoGraphics::getFontDescent(fnt))); } UT_uint32 GR_UnixPangoPrintGraphics::getFontHeight(const GR_Font * fnt) { - return static_cast(static_cast(GR_UnixPangoGraphics::getFontHeight(fnt))*m_dResRatio); + return static_cast(static_cast(GR_UnixPangoGraphics::getFontHeight(fnt))); } UT_sint32 GR_UnixPangoPrintGraphics::scale_ydir (UT_sint32 in) const @@ -3865,7 +4049,7 @@ UT_return_val_if_fail( ri, false ); GR_UnixPangoRenderInfo & RI = (GR_UnixPangoRenderInfo &)*ri; - +#if 0 for(int i = 0; i < RI.m_pGlyphs->num_glyphs; ++i) { RI.m_pGlyphs->glyphs[i].geometry.x_offset = @@ -3880,13 +4064,13 @@ (int)((double)RI.m_pGlyphs->glyphs[i].geometry.width * (double)m_iDeviceResolution / (double)m_iScreenResolution + 0.5); } - +#endif return true; } void GR_UnixPangoPrintGraphics::renderChars(GR_RenderInfo & ri) { - xxx_UT_DEBUGMSG(("GR_UnixPangoGraphics::renderChars\n")); + UT_DEBUGMSG(("GR_UnixPangoPrintGraphics::renderChars\n")); UT_return_if_fail(ri.getType() == GRRI_UNIX_PANGO); GR_UnixPangoRenderInfo & RI = (GR_UnixPangoRenderInfo &)ri; GR_UnixPangoFont * pFont = (GR_UnixPangoFont *)RI.m_pFont; @@ -3896,11 +4080,11 @@ if(RI.m_iLength == 0) return; - xxx_UT_DEBUGMSG(("PangoPrint renderChars: xoff %d yoff %d\n", RI.m_xoff, RI.m_yoff)); + UT_DEBUGMSG(("PangoPrint renderChars: xoff %d yoff %d\n", RI.m_xoff, RI.m_yoff)); UT_sint32 xoff = _tduX(RI.m_xoff); - UT_sint32 yoff = scale_ydir(_tduY(RI.m_yoff + getFontAscent(pFont))); + UT_sint32 yoff = scale_ydir(_tduY((RI.m_yoff + getFontAscent(pFont)))); - xxx_UT_DEBUGMSG(("about to gnome_print_pango_gplyph_string render xoff %d yoff %d\n", + UT_DEBUGMSG(("about to gnome_print_pango_gplyph_string render xoff %d yoff %d\n", xoff, yoff)); UT_return_if_fail(m_gpc); @@ -3921,10 +4105,24 @@ pango_font_description_free (pfd); #define _N 1440 - xxx_UT_DEBUGMSG(("@@@@ tdu(%d)== %d, _tduX(%d) == %d, _tduY(%d) == %d\n", + UT_DEBUGMSG(("@@@@ tdu(%d)== %d, _tduX(%d) == %d, _tduY(%d) == %d\n", _N, tdu(_N), _N, _tduX(_N), _N, _tduY(_N))); #undef _N - gnome_print_pango_glyph_string(m_gpc, pf, RI.m_pGlyphs); + + for(int i = 0; i < RI.m_pGlyphs->num_glyphs; ++i) + { + RI.m_pScaledGlyphs->glyphs[i].geometry.x_offset = + _tduX(RI.m_pGlyphs->glyphs[i].geometry.x_offset); + + + RI.m_pScaledGlyphs->glyphs[i].geometry.y_offset = + _tduY(RI.m_pGlyphs->glyphs[i].geometry.y_offset); + + RI.m_pScaledGlyphs->glyphs[i].geometry.width = + _tduX(RI.m_pGlyphs->glyphs[i].geometry.width ); + } + + gnome_print_pango_glyph_string(m_gpc, pf, RI.m_pScaledGlyphs); gnome_print_grestore (m_gpc); } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixPangoGraphics.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixPangoGraphics.h --- abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixPangoGraphics.h 2008-04-06 16:59:45.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixPangoGraphics.h 2008-07-13 14:09:30.000000000 +0100 @@ -76,6 +76,7 @@ virtual bool doesGlyphExist(UT_UCS4Char g); virtual bool glyphBox(UT_UCS4Char g, UT_Rect & rec, GR_Graphics * pG); PangoFont * getPangoFont() const {return m_pf;} + PangoFont * getPangoLayoutFont() const {return m_pLayoutF;} void reloadFont(GR_UnixPangoGraphics * pG); double getPointSize() const {return m_dPointSize;} @@ -84,7 +85,7 @@ const UT_String & getDescription() const {return m_sDesc;} virtual const char* getFamily() const; - const PangoFontDescription * getPangoDescription() const {return m_pfd;} + const PangoFontDescription * getPangoDescription() const {return m_pfdLay;} // ascent/descent in layout units UT_uint32 getAscent() const {return m_iAscent;} @@ -96,21 +97,24 @@ private: UT_String m_sDesc; + UT_String m_sLayoutDesc; double m_dPointSize; UT_uint32 m_iZoom; PangoFont * m_pf; bool m_bGuiFont; mutable PangoCoverage *m_pCover; - PangoFontDescription * m_pfd; + PangoFontDescription * m_pfdDev; + PangoFontDescription * m_pfdLay; PangoLanguage * m_pPLang; UT_uint32 m_iAscent; UT_uint32 m_iDescent; + PangoFont * m_pLayoutF; }; class GR_UnixPangoRenderInfo; -class GR_UnixAllocInfo : public GR_AllocInfo +class ABI_EXPORT GR_UnixAllocInfo : public GR_AllocInfo { public: GR_UnixAllocInfo(GdkWindow * win) @@ -209,6 +213,8 @@ PangoFontMap * getFontMap() const {return m_pFontMap;} PangoContext * getContext() const {return m_pContext;} + PangoFontMap * getLayoutFontMap() const {return m_pLayoutFontMap;} + PangoContext * getLayoutContext() const {return m_pLayoutContext;} virtual UT_uint32 getFontAscent(); virtual UT_uint32 getFontDescent(); @@ -257,7 +263,9 @@ int dtpu(int d) const; int ptdu(int p) const; int ptlu(int p) const; + int ptlunz(int p) const; int ltpu(int l) const; + int ltpunz(int l) const; int pftlu(int pf) const; virtual bool queryProperties(GR_Graphics::Properties gp) const; @@ -332,15 +340,19 @@ void _setColor(GdkColor & c); PangoFont * _adjustedPangoFont (GR_UnixPangoFont * pFont, PangoFont * pf); + PangoFont * _adjustedLayoutPangoFont (GR_UnixPangoFont * pFont, PangoFont * pf); protected: PangoFontMap * m_pFontMap; PangoContext * m_pContext; + PangoFontMap * m_pLayoutFontMap; + PangoContext * m_pLayoutContext; bool m_bOwnsFontMap; GR_UnixPangoFont* m_pPFont; GR_UnixPangoFont* m_pPFontGUI; PangoFont * m_pAdjustedPangoFont; + PangoFont * m_pAdjustedLayoutPangoFont; GR_UnixPangoFont* m_pAdjustedPangoFontSource; UT_uint32 m_iAdjustedPangoFontZoom; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixPangoPixmapGraphics.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixPangoPixmapGraphics.h --- abiword-2.6.2/abiword/src/af/gr/unix/gr_UnixPangoPixmapGraphics.h 2008-04-06 16:59:45.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/unix/gr_UnixPangoPixmapGraphics.h 2008-07-13 14:09:30.000000000 +0100 @@ -24,7 +24,7 @@ #include "gr_UnixPangoGraphics.h" -class GR_UnixPixmapAllocInfo : public GR_AllocInfo +class ABI_EXPORT GR_UnixPixmapAllocInfo : public GR_AllocInfo { public: GR_UnixPixmapAllocInfo(GdkPixmap * pix) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/win/gr_Win32CharWidths.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/win/gr_Win32CharWidths.h --- abiword-2.6.2/abiword/src/af/gr/win/gr_Win32CharWidths.h 2008-04-06 16:59:46.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/win/gr_Win32CharWidths.h 2008-07-13 14:09:32.000000000 +0100 @@ -26,7 +26,7 @@ // the only reason that we subclass is because Win32 provides a // routine to fetch the widths of a whole font in one call. -class GR_Win32CharWidths : public GR_CharWidths +class ABI_EXPORT GR_Win32CharWidths : public GR_CharWidths { public: void setCharWidthsOfRange(HDC hdc, UT_UCSChar c0, UT_UCSChar c1); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/win/gr_Win32Graphics.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/win/gr_Win32Graphics.cpp --- abiword-2.6.2/abiword/src/af/gr/win/gr_Win32Graphics.cpp 2008-04-06 16:59:46.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/win/gr_Win32Graphics.cpp 2008-07-13 14:09:32.000000000 +0100 @@ -68,7 +68,7 @@ /*****************************************************************/ // A small helper class -class private_FontReverter +class ABI_EXPORT private_FontReverter { public: private_FontReverter(GR_Win32Graphics& gr, GR_Font* pOldFont) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/win/gr_Win32Graphics.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/win/gr_Win32Graphics.h --- abiword-2.6.2/abiword/src/af/gr/win/gr_Win32Graphics.h 2008-04-06 16:59:46.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/win/gr_Win32Graphics.h 2008-07-13 14:09:32.000000000 +0100 @@ -150,7 +150,7 @@ ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// -class GR_Win32AllocInfo : public GR_AllocInfo +class ABI_EXPORT GR_Win32AllocInfo : public GR_AllocInfo { public: GR_Win32AllocInfo(): diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/win/gr_Win32USPGraphics.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/win/gr_Win32USPGraphics.cpp --- abiword-2.6.2/abiword/src/af/gr/win/gr_Win32USPGraphics.cpp 2008-04-06 16:59:46.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/win/gr_Win32USPGraphics.cpp 2008-07-13 14:09:32.000000000 +0100 @@ -106,7 +106,7 @@ } #define GR_WIN32_USP_FONT_SCALING 20 -class GR_Win32USPItem: public GR_Item +class ABI_EXPORT GR_Win32USPItem: public GR_Item { friend class GR_Win32USPGraphics; @@ -126,7 +126,7 @@ SCRIPT_ITEM m_si; }; -class GR_Win32USPRenderInfo : public GR_RenderInfo +class ABI_EXPORT GR_Win32USPRenderInfo : public GR_RenderInfo { public: GR_Win32USPRenderInfo(GR_ScriptType type): diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/xp/gr_Caret.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/xp/gr_Caret.h --- abiword-2.6.2/abiword/src/af/gr/xp/gr_Caret.h 2008-04-06 16:59:46.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/xp/gr_Caret.h 2008-07-13 14:09:32.000000000 +0100 @@ -122,7 +122,7 @@ UT_sint32 m_iCaretNumber; }; -class GR_CaretDisabler +class ABI_EXPORT GR_CaretDisabler { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/xp/gr_CharWidthsCache.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/xp/gr_CharWidthsCache.h --- abiword-2.6.2/abiword/src/af/gr/xp/gr_CharWidthsCache.h 2008-04-06 16:59:45.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/xp/gr_CharWidthsCache.h 2008-07-13 14:09:31.000000000 +0100 @@ -26,7 +26,7 @@ class GR_Font; class GR_CharWidths; -class GR_CharWidthsCache +class ABI_EXPORT GR_CharWidthsCache { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/xp/gr_Graphics.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/xp/gr_Graphics.h --- abiword-2.6.2/abiword/src/af/gr/xp/gr_Graphics.h 2008-04-06 16:59:46.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/xp/gr_Graphics.h 2008-07-13 14:09:32.000000000 +0100 @@ -268,7 +268,7 @@ Platform implementation needs to override getType() so that graphicsAllocator() can do type-checking. */ -class GR_AllocInfo +class ABI_EXPORT GR_AllocInfo { public: virtual ~GR_AllocInfo() {} @@ -288,7 +288,7 @@ use. The factory provides access to all graphics classes known to the application. */ -class GR_GraphicsFactory +class ABI_EXPORT GR_GraphicsFactory { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/xp/gr_Painter.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/xp/gr_Painter.h --- abiword-2.6.2/abiword/src/af/gr/xp/gr_Painter.h 2008-04-06 16:59:45.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/xp/gr_Painter.h 2008-07-13 14:09:31.000000000 +0100 @@ -23,7 +23,7 @@ #include "xap_Features.h" #include "gr_Graphics.h" -class GR_Painter +class ABI_EXPORT GR_Painter { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/gr/xp/gr_RenderInfo.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/gr/xp/gr_RenderInfo.h --- abiword-2.6.2/abiword/src/af/gr/xp/gr_RenderInfo.h 2008-04-06 16:59:46.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/gr/xp/gr_RenderInfo.h 2008-07-13 14:09:31.000000000 +0100 @@ -69,7 +69,7 @@ \note constructor should be protected; new instances can only be created via GR_Graphics::newItem() */ -class GR_Item +class ABI_EXPORT GR_Item { public: virtual ~GR_Item(){}; @@ -82,7 +82,7 @@ }; -class GR_XPItem : public GR_Item +class ABI_EXPORT GR_XPItem : public GR_Item { friend class GR_Graphics; @@ -119,7 +119,7 @@ getItemCount() returns the count of all items, including the dummy GRScriptType_Void item. */ -class GR_Itemization +class ABI_EXPORT GR_Itemization { public: GR_Itemization(): @@ -206,7 +206,7 @@ always set them if the function to which GR_RenderInfo is passed is going to use them */ -class GR_RenderInfo +class ABI_EXPORT GR_RenderInfo { public: GR_RenderInfo(GR_ScriptType type) @@ -265,7 +265,7 @@ This is an xp implementation of GR_RenderInfo for use with the built in UT_contextGlyph class. */ -class GR_XPRenderInfo : public GR_RenderInfo +class ABI_EXPORT GR_XPRenderInfo : public GR_RenderInfo { public: GR_XPRenderInfo(GR_ScriptType type); @@ -310,7 +310,7 @@ /** Encapsulates input to GR_Graphics::shape() */ -class GR_ShapingInfo +class ABI_EXPORT GR_ShapingInfo { public: GR_ShapingInfo(UT_TextIterator & text, UT_uint32 iLen, diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/unix/ut_unixAssert.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/unix/ut_unixAssert.cpp --- abiword-2.6.2/abiword/src/af/util/unix/ut_unixAssert.cpp 2008-04-06 17:00:05.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/unix/ut_unixAssert.cpp 2008-07-13 14:09:51.000000000 +0100 @@ -25,7 +25,7 @@ #include "ut_assert.h" #include "ut_unixAssert.h" -void UT_UnixAssertMsg(const char * szMsg, const char * szFile, int iLine) +int UT_UnixAssertMsg(const char * szMsg, const char * szFile, int iLine) { static int count = 0; @@ -34,7 +34,7 @@ printf("**** (%d) %s at %s:%d ****\n", count,szMsg,szFile,iLine); while (1) { - printf("**** (%d) Continue ? (y/n) [y] : ", count); + printf("**** (%d) Continue ? (y/n/i(gnore)) [y] : ", count); fflush(stdout); char buf[10]; @@ -48,12 +48,17 @@ case '\n': case 'y': case 'Y': - return; // continue the application + return 1; // continue the application case 'n': case 'N': abort(); // kill the application - return; + return 0; + + case 'i': + case 'I': + return -1; + default: break; // ?? ask them again } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/unix/ut_unixAssert.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/unix/ut_unixAssert.h --- abiword-2.6.2/abiword/src/af/util/unix/ut_unixAssert.h 2008-04-06 17:00:05.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/unix/ut_unixAssert.h 2008-07-13 14:09:51.000000000 +0100 @@ -20,6 +20,6 @@ #ifndef UT_UNIXASSERT_H #define UT_UNIXASSERT_H -void UT_UnixAssertMsg(const char * szMsg, const char * szFile, int iLine); +int UT_UnixAssertMsg(const char * szMsg, const char * szFile, int iLine); #endif /* UT_UNIXASSERT_H */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/unix/ut_unixDirent.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/unix/ut_unixDirent.cpp --- abiword-2.6.2/abiword/src/af/util/unix/ut_unixDirent.cpp 2008-04-06 17:00:05.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/unix/ut_unixDirent.cpp 2008-07-13 14:09:51.000000000 +0100 @@ -47,6 +47,8 @@ #include #include +#include + #include "ut_unixDirent.h" /* diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/win/ut_mutexImpl.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/win/ut_mutexImpl.h --- abiword-2.6.2/abiword/src/af/util/win/ut_mutexImpl.h 2008-04-06 17:00:12.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/win/ut_mutexImpl.h 2008-07-13 14:09:56.000000000 +0100 @@ -21,11 +21,12 @@ #define UT_MUTEXIMPL_H #include +#include "ut_types.h" /*! * Win32 implementation of a mutex class */ -class UT_MutexImpl +class ABI_EXPORT UT_MutexImpl { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/win/ut_Win32Idle.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/win/ut_Win32Idle.h --- abiword-2.6.2/abiword/src/af/util/win/ut_Win32Idle.h 2008-04-06 17:00:12.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/win/ut_Win32Idle.h 2008-07-13 14:09:56.000000000 +0100 @@ -25,7 +25,7 @@ #include "ut_idle.h" #include "ut_vector.h" -class UT_Win32Idle : public UT_Idle +class ABI_EXPORT UT_Win32Idle : public UT_Idle { public: UT_Win32Idle(UT_WorkerCallback pCallback, void* pData); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/win/ut_Win32Misc.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/win/ut_Win32Misc.cpp --- abiword-2.6.2/abiword/src/af/util/win/ut_Win32Misc.cpp 2008-04-06 17:00:12.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/win/ut_Win32Misc.cpp 2008-07-13 14:09:56.000000000 +0100 @@ -413,7 +413,7 @@ Class that implements an assert dialogue; this is a private class, we only access it through UT_Win32ThrowAssert() function */ -class UT_Win32AssertDlg +class ABI_EXPORT UT_Win32AssertDlg { friend int ABI_EXPORT UT_Win32ThrowAssert(const char *, const char *, int, int); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_allocator.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_allocator.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_allocator.h 2008-04-06 17:00:12.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_allocator.h 2008-07-13 14:09:55.000000000 +0100 @@ -25,7 +25,7 @@ * This class is responsible for creating and destroying memory buffers * It provides a default implementation based on g_try_malloc/g_free */ -class UT_Allocator +class ABI_EXPORT UT_Allocator { public: UT_Allocator (); @@ -42,7 +42,7 @@ /*! * Returns zeroed memory, either via g_try_malloc&memset or UT_calloc */ -class UT_NullAllocator : public UT_Allocator +class ABI_EXPORT UT_NullAllocator : public UT_Allocator { public: UT_NullAllocator (); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_assert.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_assert.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_assert.h 2008-04-06 17:00:10.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_assert.h 2008-07-13 14:09:54.000000000 +0100 @@ -195,10 +195,12 @@ // Please keep the "/**/" to stop MSVC dependency generator complaining. # include /**/ "ut_unixAssert.h" # define UT_ASSERT(expr) \ - ((void) ((expr) || \ - (UT_UnixAssertMsg(#expr, \ - __FILE__, __LINE__), \ - 0))) + { \ + static bool __bOnceOnly = false; \ + if (!__bOnceOnly && !(expr)) \ + if (UT_UnixAssertMsg(#expr, __FILE__, __LINE__) == -1) \ + __bOnceOnly = true; \ + } # endif #endif diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_bytebuf.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_bytebuf.cpp --- abiword-2.6.2/abiword/src/af/util/xp/ut_bytebuf.cpp 2008-04-06 17:00:09.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_bytebuf.cpp 2008-07-13 14:09:54.000000000 +0100 @@ -198,7 +198,7 @@ if(!fp) return false; - bool res = insertFromInput (0, fp); + bool res = insertFromInput (iPosition, fp); g_object_unref (fp); return res; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_crc32.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_crc32.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_crc32.h 2008-04-06 17:00:10.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_crc32.h 2008-07-13 14:09:54.000000000 +0100 @@ -12,7 +12,7 @@ #endif //! CRC Checksum Calculation -class UT_CRC32 +class ABI_EXPORT UT_CRC32 { public: enum {DIGESTSIZE = 4}; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_go_file.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_go_file.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_go_file.h 2008-04-06 17:00:10.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_go_file.h 2008-07-13 14:09:54.000000000 +0100 @@ -20,7 +20,13 @@ #ifndef UT_GO_FILE_H #define UT_GO_FILE_H - +/* pre-emptive dismissal; ut_types.h is needed by just about everything, + * so even if it's commented out in-file that's still a lot of work for + * the preprocessor to do... + */ +#ifndef UT_TYPES_H +#include "ut_types.h" +#endif #include #include @@ -51,52 +57,52 @@ UT_GO_DOTDOT_LEAVE /* Leave alone. */ } UT_GODotDot; -gboolean UT_go_path_is_uri (const char * path); +ABI_EXPORT gboolean UT_go_path_is_uri (const char * path); -char *UT_go_filename_simplify (const char *filename, UT_GODotDot dotdot, gboolean make_absolute); -char *UT_go_url_simplify (const char *uri); +ABI_EXPORT char *UT_go_filename_simplify (const char *filename, UT_GODotDot dotdot, gboolean make_absolute); +ABI_EXPORT char *UT_go_url_simplify (const char *uri); -char *UT_go_filename_from_uri (const char *uri); -char *UT_go_filename_to_uri (const char *filename); +ABI_EXPORT char *UT_go_filename_from_uri (const char *uri); +ABI_EXPORT char *UT_go_filename_to_uri (const char *filename); -char *UT_go_url_resolve_relative (const char *ref_uri, const char *rel_uri); -char *UT_go_url_make_relative (const char *uri, const char *ref_uri); +ABI_EXPORT char *UT_go_url_resolve_relative (const char *ref_uri, const char *rel_uri); +ABI_EXPORT char *UT_go_url_make_relative (const char *uri, const char *ref_uri); -char *UT_go_shell_arg_to_uri (const char *arg); -char *UT_go_basename_from_uri (const char *uri); -char *UT_go_dirname_from_uri (const char *uri, gboolean brief); -gboolean UT_go_directory_create (char const *uri, int mode, GError **err); -gchar const **UT_go_shell_argv_to_glib_encoding (gint argc, gchar const **argv); -void UT_go_shell_argv_to_glib_encoding_free (void); +ABI_EXPORT char *UT_go_shell_arg_to_uri (const char *arg); +ABI_EXPORT char *UT_go_basename_from_uri (const char *uri); +ABI_EXPORT char *UT_go_dirname_from_uri (const char *uri, gboolean brief); +ABI_EXPORT gboolean UT_go_directory_create (char const *uri, int mode, GError **err); +ABI_EXPORT gchar const **UT_go_shell_argv_to_glib_encoding (gint argc, gchar const **argv); +ABI_EXPORT void UT_go_shell_argv_to_glib_encoding_free (void); -GsfInput *UT_go_file_open (char const *uri, GError **err); -GsfOutput *UT_go_file_create (char const *uri, GError **err); -GSList *UT_go_file_split_urls (char const *data); +ABI_EXPORT GsfInput *UT_go_file_open (char const *uri, GError **err); +ABI_EXPORT GsfOutput *UT_go_file_create (char const *uri, GError **err); +ABI_EXPORT GSList *UT_go_file_split_urls (char const *data); -gboolean UT_go_file_remove (char const *uri, GError **err); +ABI_EXPORT gboolean UT_go_file_remove (char const *uri, GError **err); -gboolean UT_go_file_exists (char const *uri); +ABI_EXPORT gboolean UT_go_file_exists (char const *uri); -UT_GOFilePermissions *UT_go_get_file_permissions (char const *uri); -void UT_go_set_file_permissions (char const *uri, UT_GOFilePermissions * file_permissions); +ABI_EXPORT UT_GOFilePermissions *UT_go_get_file_permissions (char const *uri); +ABI_EXPORT void UT_go_set_file_permissions (char const *uri, UT_GOFilePermissions * file_permissions); -time_t UT_go_file_get_date_accessed (char const *uri); -time_t UT_go_file_get_date_modified (char const *uri); -time_t UT_go_file_get_date_changed (char const *uri); +ABI_EXPORT time_t UT_go_file_get_date_accessed (char const *uri); +ABI_EXPORT time_t UT_go_file_get_date_modified (char const *uri); +ABI_EXPORT time_t UT_go_file_get_date_changed (char const *uri); -gchar *UT_go_url_decode (gchar const *text); -gchar *UT_go_url_encode (gchar const *text, int type); -GError *UT_go_url_show (gchar const *url); -gboolean UT_go_url_check_extension (gchar const *uri, +ABI_EXPORT gchar *UT_go_url_decode (gchar const *text); +ABI_EXPORT gchar *UT_go_url_encode (gchar const *text, int type); +ABI_EXPORT GError *UT_go_url_show (gchar const *url); +ABI_EXPORT gboolean UT_go_url_check_extension (gchar const *uri, gchar const *std_ext, gchar **new_uri); -gchar *UT_go_get_mime_type (gchar const *uri); -gchar *UT_go_get_mime_type_for_data (gconstpointer data, int data_size); -gchar const *UT_go_mime_type_get_description (gchar const *mime_type); - -const char * UT_go_guess_encoding (const char *raw, size_t len, const char *user_guess, char **utf8_str); -char const * UT_go_get_real_name (void); -gint UT_go_utf8_collate_casefold (const char *a, const char *b); +ABI_EXPORT gchar *UT_go_get_mime_type (gchar const *uri); +ABI_EXPORT gchar *UT_go_get_mime_type_for_data (gconstpointer data, int data_size); +ABI_EXPORT gchar const *UT_go_mime_type_get_description (gchar const *mime_type); + +ABI_EXPORT const char * UT_go_guess_encoding (const char *raw, size_t len, const char *user_guess, char **utf8_str); +ABI_EXPORT char const * UT_go_get_real_name (void); +ABI_EXPORT gint UT_go_utf8_collate_casefold (const char *a, const char *b); G_END_DECLS diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_hash.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_hash.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_hash.h 2008-04-06 17:00:10.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_hash.h 2008-07-13 14:09:54.000000000 +0100 @@ -1,3 +1,5 @@ +/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ + /* AbiSource Program Utilities * * Copyright (C) 2001 Mike Nordell @@ -45,13 +47,13 @@ #endif // fwd. decl. -template class hash_slot; +template class ABI_EXPORT hash_slot; template class ABI_EXPORT UT_GenericStringMap; // Like a std cursor -class _UT_StringMapImp +class ABI_EXPORT _UT_StringMapImp { @@ -62,7 +64,7 @@ { public: UT_GenericStringMap(size_t expected_cardinality = 11); - ~UT_GenericStringMap(); + virtual ~UT_GenericStringMap(); // insertion/addition bool insert(const char* key, T value); @@ -95,7 +97,7 @@ inline size_t cardinality() const { return n_keys; } inline size_t size() const { return n_keys; } - class UT_Cursor + class ABI_EXPORT UT_Cursor { friend class UT_GenericStringMap; @@ -244,18 +246,24 @@ //template class ABI_EXPORT UT_GenericStringMap; #endif -typedef UT_GenericStringMap UT_StringPtrMap; - +// TODO Rob: try to export like this once plugin loading is fixed: +// template class ABI_EXPORT UT_GenericStringMap; +class ABI_EXPORT UT_StringPtrMap : public UT_GenericStringMap { +public: + UT_StringPtrMap(size_t expected_cardinality = 11) + : UT_GenericStringMap(expected_cardinality) + {} +}; // Template implementation // fwd. decls. -UT_uint32 _Recommended_hash_size(UT_uint32 size); +ABI_EXPORT UT_uint32 _Recommended_hash_size(UT_uint32 size); // wrapper class for keys -class key_wrapper +class ABI_EXPORT key_wrapper { public: key_wrapper() @@ -307,7 +315,7 @@ // bucket for data -template class hash_slot +template class ABI_EXPORT hash_slot { public: hash_slot() diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_html.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_html.cpp --- abiword-2.6.2/abiword/src/af/util/xp/ut_html.cpp 2008-04-06 17:00:11.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_html.cpp 2008-07-13 14:09:54.000000000 +0100 @@ -171,8 +171,8 @@ if (htmlParseChunk (ctxt, buffer, static_cast(length), 0)) { UT_DEBUGMSG (("Error parsing '%s' (Line: %d, Column: %d)\n", - szFilename, getLineNumber(ctxt), - getColumnNumber(ctxt))); + szFilename, xmlSAX2GetLineNumber(ctxt), + xmlSAX2GetColumnNumber(ctxt))); ret = UT_IE_IMPORTERROR; break; } @@ -183,8 +183,8 @@ if (htmlParseChunk (ctxt, 0, 0, 1)) { UT_DEBUGMSG (("Error parsing '%s' (Line: %d, Column: %d)\n", - szFilename, getLineNumber(ctxt), - getColumnNumber(ctxt))); + szFilename, xmlSAX2GetLineNumber(ctxt), + xmlSAX2GetColumnNumber(ctxt))); ret = UT_IE_IMPORTERROR; } } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_iconv.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_iconv.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_iconv.h 2008-04-06 17:00:11.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_iconv.h 2008-07-13 14:09:55.000000000 +0100 @@ -62,27 +62,27 @@ G_BEGIN_DECLS -const char * ucs2Internal (); +ABI_EXPORT const char * ucs2Internal (); #define UCS_2_INTERNAL ucs2Internal() -const char * ucs4Internal (); +ABI_EXPORT const char * ucs4Internal (); #define UCS_INTERNAL ucs4Internal() -UT_iconv_t UT_iconv_open( const char* to, const char* from ); -size_t UT_iconv( UT_iconv_t cd, const char **inbuf, +ABI_EXPORT UT_iconv_t UT_iconv_open( const char* to, const char* from ); +ABI_EXPORT size_t UT_iconv( UT_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft ); -int UT_iconv_close( UT_iconv_t cd ); -void UT_iconv_reset( UT_iconv_t cd ); -int UT_iconv_isValid ( UT_iconv_t cd ); +ABI_EXPORT int UT_iconv_close( UT_iconv_t cd ); +ABI_EXPORT void UT_iconv_reset( UT_iconv_t cd ); +ABI_EXPORT int UT_iconv_isValid ( UT_iconv_t cd ); -char * UT_convert (const char *str, +ABI_EXPORT char * UT_convert (const char *str, UT_sint32 len, const char *from_codeset, const char *to_codeset, UT_uint32 *bytes_read, UT_uint32 *bytes_written); -char * UT_convert_cd (const char *str, +ABI_EXPORT char * UT_convert_cd (const char *str, UT_sint32 len, UT_iconv_t cd, UT_uint32 *bytes_read, diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_locale.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_locale.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_locale.h 2008-04-06 17:00:10.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_locale.h 2008-07-13 14:09:54.000000000 +0100 @@ -23,7 +23,7 @@ #include #include "ut_string_class.h" -class UT_LocaleTransactor +class ABI_EXPORT UT_LocaleTransactor { public: @@ -40,7 +40,7 @@ char * mOldLocale; }; -class UT_LocaleInfo +class ABI_EXPORT UT_LocaleInfo { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_misc.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_misc.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_misc.h 2008-04-06 17:00:09.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_misc.h 2008-07-13 14:09:54.000000000 +0100 @@ -214,7 +214,7 @@ UT_uint32 m_iID[(UT_uint32)_Last]; }; -bool UT_parseBool (const char * param, bool dfl); +ABI_EXPORT bool UT_parseBool (const char * param, bool dfl); #if 0 diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_mutex.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_mutex.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_mutex.h 2008-04-06 17:00:11.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_mutex.h 2008-07-13 14:09:55.000000000 +0100 @@ -19,6 +19,14 @@ #ifndef UT_MUTEX_H #define UT_MUTEX_H +/* pre-emptive dismissal; ut_types.h is needed by just about everything, + * so even if it's commented out in-file that's still a lot of work for + * the preprocessor to do... + */ +#ifndef UT_TYPES_H +#include "ut_types.h" +#endif + class UT_MutexImpl; class UT_MutexAcquirer; @@ -30,7 +38,7 @@ * UT_MutexImpl has the same signature as UT_Mutex except that it's * implemented in platform-specific code */ -class UT_Mutex +class ABI_EXPORT UT_Mutex { friend class UT_MutexImpl; friend class UT_MutexAcquirer; @@ -67,7 +75,7 @@ * // done transparently by the acquirer * } */ -class UT_MutexAcquirer +class ABI_EXPORT UT_MutexAcquirer { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_PropVector.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_PropVector.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_PropVector.h 2008-04-06 17:00:11.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_PropVector.h 2008-07-13 14:09:55.000000000 +0100 @@ -22,7 +22,7 @@ #include "ut_vector.h" -class UT_PropVector +class ABI_EXPORT UT_PropVector : public UT_GenericVector { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_stringbuf.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_stringbuf.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_stringbuf.h 2008-04-06 17:00:10.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_stringbuf.h 2008-07-13 14:09:54.000000000 +0100 @@ -46,7 +46,7 @@ template -class UT_StringImpl +class ABI_EXPORT UT_StringImpl { public: UT_StringImpl(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_string_class.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_string_class.cpp --- abiword-2.6.2/abiword/src/af/util/xp/ut_string_class.cpp 2008-04-06 17:00:11.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_string_class.cpp 2008-07-13 14:09:55.000000000 +0100 @@ -269,18 +269,9 @@ UT_String& UT_String_vprintf (UT_String & inStr, const char *format, va_list args1) { - char *buffer; - va_list args2; - - G_VA_COPY (args2, args1); - - buffer = new char [ g_printf_string_upper_bound (format, args1) ]; - vsprintf (buffer, format, args2); - va_end (args2); - + char *buffer = g_strdup_vprintf(format, args1); inStr = buffer; - - delete [] buffer; + g_free(buffer); return inStr; } @@ -556,6 +547,7 @@ bool operator==(const UT_String& s1, const UT_String& s2) { + if (s1.size() != s2.size()) return false; return strcmp(s1.c_str(), s2.c_str()) == 0; } @@ -1190,12 +1182,13 @@ } bool operator==(const UT_UTF8String& s1, const UT_UTF8String& s2) { + if (s1.size() != s2.size()) return false; return strcmp(s1.utf8_str(), s2.utf8_str()) == 0; } bool operator!=(const UT_UTF8String& s1, const UT_UTF8String& s2) { - return strcmp(s1.utf8_str(), s2.utf8_str()) != 0; + return !(s1 == s2); } bool operator==(const UT_UTF8String& s1, const char * s2) @@ -1210,11 +1203,13 @@ bool operator==(const UT_UTF8String& s1, const std::string &s2) { + if (s1.size() != s2.size()) return false; return s1.utf8_str() == s2; } bool operator!=(const UT_UTF8String& s1, const std::string &s2) { + if (s1.size() != s2.size()) return true; return s1.utf8_str() != s2; } @@ -1482,6 +1477,7 @@ bool operator==(const UT_UCS4String& s1, const UT_UCS4String& s2) { + if (s1.size() != s2.size()) return false; return UT_UCS4_strcmp(s1.ucs4_str(), s2.ucs4_str()) == 0; } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_unicode.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_unicode.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_unicode.h 2008-04-06 17:00:11.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_unicode.h 2008-07-13 14:09:55.000000000 +0100 @@ -31,7 +31,7 @@ /** contain various unicode function. Just a namespace */ -class UT_Unicode +class ABI_EXPORT UT_Unicode { public: /** scans a buffer for the next valid UTF-8 sequence and returns the corresponding diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_vector.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_vector.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_vector.h 2008-04-06 17:00:11.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_vector.h 2008-07-13 14:09:55.000000000 +0100 @@ -140,12 +140,23 @@ UT_uint32 m_iPostCutoffIncrement; }; -#if 0 //def _MSC_VER // have to intialise the templates in order to have class exported -#include "ut_Win32Vector.h" -#endif +// TODO Rob: try to export like this once plugin loading is fixed: +// template class ABI_EXPORT UT_GenericVector; +class ABI_EXPORT UT_Vector : public UT_GenericVector { +public: + UT_Vector(UT_uint32 sizehint = 32, UT_uint32 baseincr = 4, bool bPrealloc = false) + : UT_GenericVector(sizehint, baseincr, bPrealloc) + {} +}; -typedef ABI_EXPORT UT_GenericVector UT_Vector; -typedef ABI_EXPORT UT_GenericVector UT_NumberVector; +// TODO Rob: try to export like this once plugin loading is fixed: +// template class ABI_EXPORT UT_GenericVector; +class ABI_EXPORT UT_NumberVector : public UT_GenericVector { +public: + UT_NumberVector(UT_uint32 sizehint = 32, UT_uint32 baseincr = 4, bool bPrealloc = false) + : UT_GenericVector(sizehint, baseincr, bPrealloc) + {} +}; #include #include diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_xml.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_xml.cpp --- abiword-2.6.2/abiword/src/af/util/xp/ut_xml.cpp 2008-04-06 17:00:11.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_xml.cpp 2008-07-13 14:09:55.000000000 +0100 @@ -356,7 +356,7 @@ /**************************************************************/ /**************************************************************/ -class UT_XML_Decoder : public UT_XML::Listener +class ABI_EXPORT UT_XML_Decoder : public UT_XML::Listener { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_xml.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_xml.h --- abiword-2.6.2/abiword/src/af/util/xp/ut_xml.h 2008-04-06 17:00:10.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_xml.h 2008-07-13 14:09:54.000000000 +0100 @@ -195,7 +195,7 @@ void defaultData (const gchar * buffer, int length); }; -class DefaultReader : public UT_XML::Reader +class ABI_EXPORT DefaultReader : public UT_XML::Reader { public: DefaultReader (); @@ -214,7 +214,7 @@ * * NOTE: The buffer is not copied, or g_free()ed. */ -class UT_XML_BufReader : public UT_XML::Reader +class ABI_EXPORT UT_XML_BufReader : public UT_XML::Reader { public: UT_XML_BufReader (const char * buffer, UT_uint32 length); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/util/xp/ut_xml_libxml2.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/util/xp/ut_xml_libxml2.cpp --- abiword-2.6.2/abiword/src/af/util/xp/ut_xml_libxml2.cpp 2008-04-06 17:00:09.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/util/xp/ut_xml_libxml2.cpp 2008-07-13 14:09:53.000000000 +0100 @@ -207,7 +207,7 @@ { if(getNumMinorErrors() > getNumRecoveredErrors()) { - UT_DEBUGMSG (("Error - 1 parsing '%s' (Line: %d, Column: %d)\n", szFilename, getLineNumber(ctxt), getColumnNumber(ctxt))); + UT_DEBUGMSG (("Error - 1 parsing '%s' (Line: %d, Column: %d)\n", szFilename, xmlSAX2GetLineNumber(ctxt), xmlSAX2GetColumnNumber(ctxt))); ret = UT_IE_IMPORTERROR; break; } @@ -218,7 +218,7 @@ { if (xmlParseChunk (ctxt, "", 0, 1)) { - UT_DEBUGMSG (("Error -2 parsing '%s' (Line: %d, Column: %d)\n", szFilename, getLineNumber(ctxt), getColumnNumber(ctxt))); + UT_DEBUGMSG (("Error -2 parsing '%s' (Line: %d, Column: %d)\n", szFilename, xmlSAX2GetLineNumber(ctxt), xmlSAX2GetColumnNumber(ctxt))); ret = UT_IE_IMPORTERROR; } } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixApp.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixApp.cpp --- abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixApp.cpp 2008-04-06 16:59:48.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixApp.cpp 2008-07-13 14:09:34.000000000 +0100 @@ -180,8 +180,6 @@ bool XAP_UnixApp::initialize(const char * szKeyBindingsKey, const char * szKeyBindingsDefaultValue) { - if (!g_thread_supported ()) g_thread_init (NULL); - // let our base class do it's thing. XAP_App::initialize(szKeyBindingsKey, szKeyBindingsDefaultValue); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixDlg_FontChooser.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixDlg_FontChooser.cpp --- abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixDlg_FontChooser.cpp 2008-04-06 16:59:47.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixDlg_FontChooser.cpp 2008-07-13 14:09:34.000000000 +0100 @@ -1,3 +1,5 @@ +/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ + /* AbiSource Application Framework * Copyright (C) 1998-2000 AbiSource, Inc. * @@ -175,7 +177,7 @@ return FALSE; } -static void s_select_row_font(GtkWidget * /* widget */, XAP_UnixDialog_FontChooser * dlg) +static void s_select_row_font(GtkTreeSelection * /* widget */, XAP_UnixDialog_FontChooser * dlg) { UT_return_if_fail(dlg); // update the row number and show the changed preview @@ -184,7 +186,7 @@ } -static void s_select_row_style(GtkWidget * /* widget */, XAP_UnixDialog_FontChooser * dlg) +static void s_select_row_style(GtkTreeSelection * /* widget */, XAP_UnixDialog_FontChooser * dlg) { UT_return_if_fail(dlg); @@ -192,7 +194,7 @@ dlg->styleRowChanged(); } -static void s_select_row_size(GtkWidget * /* widget */, XAP_UnixDialog_FontChooser * dlg) +static void s_select_row_size(GtkTreeSelection * /* widget */, XAP_UnixDialog_FontChooser * dlg) { UT_return_if_fail(dlg); @@ -288,17 +290,18 @@ void XAP_UnixDialog_FontChooser::fontRowChanged(void) { static char szFontFamily[60]; - GtkTreeSelection* selection; - GtkTreeModel* model; + GtkTreeSelection *selection; + GtkTreeModel *model; GtkTreeIter iter; - gchar* text; + gchar *text; + model = gtk_tree_view_get_model(GTK_TREE_VIEW(m_fontList)); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(m_fontList)); if ( gtk_tree_selection_get_selected (selection, &model, &iter) ) { gtk_tree_model_get(model, &iter, TEXT_COLUMN, &text, -1); - UT_ASSERT(text); g_snprintf(szFontFamily, 50, "%s",text); + g_free(text), text = NULL; addOrReplaceVecProp("font-family",static_cast(szFontFamily)); } @@ -310,7 +313,6 @@ GtkTreeSelection* selection; GtkTreeModel* model; GtkTreeIter iter; - gchar* text; gint rowNumber; GtkTreePath* path; @@ -321,9 +323,6 @@ rowNumber = gtk_tree_path_get_indices(path)[0]; gtk_tree_path_free(path); - gtk_tree_model_get(model, &iter, TEXT_COLUMN, &text, -1); - UT_ASSERT(text); - // perhaps these attributes really should be smashed // into bitfields. :) if (rowNumber == LIST_STYLE_NORMAL) @@ -369,13 +368,9 @@ { gtk_tree_model_get(model, &iter, TEXT_COLUMN, &text, -1); UT_ASSERT(text); - g_snprintf(szFontSize, 50, "%spt", static_cast(XAP_EncodingManager::fontsizes_mapping.lookupByTarget(text))); - -// g_snprintf(szFontSize, 50, "%spt",(UT_convertToPoints(text[0]))); -// g_snprintf(szFontSize, 50, "%spt",text[0]); - + g_free(text), text = NULL; addOrReplaceVecProp("font-size",static_cast(szFontSize)); } updatePreview(); @@ -447,6 +442,7 @@ // the Windows layout, with some changes for color selector GtkWidget * XAP_UnixDialog_FontChooser::constructWindowContents(GtkWidget *parent) { + GtkTreeSelection *selection; GtkWidget *vboxMain; GtkWidget *notebookMain; GtkWidget *labelFont; @@ -778,19 +774,26 @@ G_CALLBACK(s_transparency_toggled), static_cast(this)); - g_signal_connect(G_OBJECT(listFonts), - "cursor_changed", + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listFonts)); + g_signal_connect(G_OBJECT(selection), + "changed", G_CALLBACK(s_select_row_font), static_cast(this)); + selection = NULL; - g_signal_connect(G_OBJECT(listStyles), - "cursor_changed", + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listStyles)); + g_signal_connect(G_OBJECT(selection), + "changed", G_CALLBACK(s_select_row_style), static_cast(this)); - g_signal_connect(G_OBJECT(listSizes), - "cursor_changed", + selection = NULL; + + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(listSizes)); + g_signal_connect(G_OBJECT(selection), + "changed", G_CALLBACK(s_select_row_size), static_cast(this)); + selection = NULL; // This is a catch-all color selector callback which catches any // real-time updating of the color so we can refresh our preview diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixDlg_FontChooser.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixDlg_FontChooser.h --- abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixDlg_FontChooser.h 2008-04-06 16:59:47.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixDlg_FontChooser.h 2008-07-13 14:09:33.000000000 +0100 @@ -1,3 +1,5 @@ +/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ + /* AbiSource Application Framework * Copyright (C) 1998-2000 AbiSource, Inc. * diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixDlg_History.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixDlg_History.cpp --- abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixDlg_History.cpp 2008-04-06 16:59:47.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixDlg_History.cpp 2008-07-13 14:09:34.000000000 +0100 @@ -56,7 +56,8 @@ } UT_DEBUGMSG(("In s_history_selected \n")); // Get the row and col number - GValue value = {0,}; + GValue value; + g_value_init(&value, G_TYPE_INVALID); gtk_tree_model_get_value (model, &iter,3,&value); item = g_value_get_int(&value); UT_DEBUGMSG(("Vlaue of id selected %d \n",item)); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixFrameImpl.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixFrameImpl.cpp --- abiword-2.6.2/abiword/src/af/xap/unix/xap_UnixFrameImpl.cpp 2008-04-06 16:59:47.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/unix/xap_UnixFrameImpl.cpp 2008-07-13 14:09:34.000000000 +0100 @@ -1803,7 +1803,7 @@ pUnixKeyboard->charDataEvent(pView, static_cast(0), text, strlen(text)); - UT_DEBUGMSG(("<<<<<<<<_imCommit: text %s, len %d\n", text, strlen(text))); + xxx_UT_DEBUGMSG(("<<<<<<<<_imCommit: text %s, len %d\n", text, strlen(text))); } GtkIMContext * XAP_UnixFrameImpl::getIMContext() diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32App.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32App.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32App.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32App.h 2008-07-13 14:09:45.000000000 +0100 @@ -41,7 +41,7 @@ ****************************************************************** *****************************************************************/ -class XAP_Win32App : public XAP_App +class ABI_EXPORT XAP_Win32App : public XAP_App { public: XAP_Win32App(HINSTANCE hInstance, XAP_Args * pArgs, const char * szAppName); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32AppImpl.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32AppImpl.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32AppImpl.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32AppImpl.h 2008-07-13 14:09:46.000000000 +0100 @@ -22,7 +22,7 @@ #include "xap_AppImpl.h" -class XAP_Win32AppImpl +class ABI_EXPORT XAP_Win32AppImpl : public XAP_AppImpl { protected: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Clipboard.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Clipboard.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Clipboard.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Clipboard.h 2008-07-13 14:09:45.000000000 +0100 @@ -24,7 +24,7 @@ #include "ut_vector.h" #include "xap_Clipboard.h" -class XAP_Win32Clipboard +class ABI_EXPORT XAP_Win32Clipboard { public: XAP_Win32Clipboard(void); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32ColourButton.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32ColourButton.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32ColourButton.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32ColourButton.h 2008-07-13 14:09:45.000000000 +0100 @@ -25,7 +25,7 @@ #define COLOUR_SMPLENGTH 20 #define COLOUR_SMPHIGH 10 -class XAP_Win32ColourButton +class ABI_EXPORT XAP_Win32ColourButton { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32DialogBase.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32DialogBase.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32DialogBase.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32DialogBase.h 2008-07-13 14:09:46.000000000 +0100 @@ -39,7 +39,7 @@ class XAP_Frame; class XAP_StringSet; -class XAP_Win32DialogBase +class ABI_EXPORT XAP_Win32DialogBase { public: XAP_Win32DialogBase() : m_tag(magic_tag), m_hDlg(0), m_pDlg(0), m_pSS(0) {} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32DialogHelper.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32DialogHelper.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32DialogHelper.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32DialogHelper.h 2008-07-13 14:09:46.000000000 +0100 @@ -35,7 +35,7 @@ #include "xap_Win32FrameImpl.h" #include "ut_Xpm2Bmp.h" -class XAP_Win32Dialog +class ABI_EXPORT XAP_Win32Dialog { public: virtual BOOL _onInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam) = 0; @@ -43,7 +43,7 @@ virtual BOOL _onDeltaPos(NM_UPDOWN * pnmud) = 0; }; -class XAP_Win32DialogHelper +class ABI_EXPORT XAP_Win32DialogHelper { public: XAP_Win32DialogHelper(XAP_Win32Dialog* p_dialog) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_About.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_About.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_About.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_About.h 2008-07-13 14:09:45.000000000 +0100 @@ -25,7 +25,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_About: public XAP_Dialog_About +class ABI_EXPORT XAP_Win32Dialog_About: public XAP_Dialog_About { public: XAP_Win32Dialog_About(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_ClipArt.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_ClipArt.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_ClipArt.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_ClipArt.h 2008-07-13 14:09:46.000000000 +0100 @@ -25,7 +25,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_ClipArt: public XAP_Dialog_ClipArt +class ABI_EXPORT XAP_Win32Dialog_ClipArt: public XAP_Dialog_ClipArt { public: XAP_Win32Dialog_ClipArt(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_DocComparison.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_DocComparison.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_DocComparison.h 2008-04-06 16:59:59.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_DocComparison.h 2008-07-13 14:09:47.000000000 +0100 @@ -27,7 +27,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_DocComparison: public XAP_Dialog_DocComparison +class ABI_EXPORT XAP_Win32Dialog_DocComparison: public XAP_Dialog_DocComparison { public: XAP_Win32Dialog_DocComparison(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Encoding.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Encoding.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Encoding.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Encoding.h 2008-07-13 14:09:46.000000000 +0100 @@ -27,7 +27,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_Encoding: public XAP_Win32DialogBase, public XAP_Dialog_Encoding +class ABI_EXPORT XAP_Win32Dialog_Encoding: public XAP_Win32DialogBase, public XAP_Dialog_Encoding { public: XAP_Win32Dialog_Encoding(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_FileOpenSaveAs.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_FileOpenSaveAs.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_FileOpenSaveAs.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_FileOpenSaveAs.h 2008-07-13 14:09:46.000000000 +0100 @@ -29,7 +29,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_FileOpenSaveAs : public XAP_Dialog_FileOpenSaveAs +class ABI_EXPORT XAP_Win32Dialog_FileOpenSaveAs : public XAP_Dialog_FileOpenSaveAs { public: XAP_Win32Dialog_FileOpenSaveAs(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_FontChooser.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_FontChooser.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_FontChooser.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_FontChooser.h 2008-07-13 14:09:45.000000000 +0100 @@ -27,7 +27,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_FontChooser : public XAP_Dialog_FontChooser +class ABI_EXPORT XAP_Win32Dialog_FontChooser : public XAP_Dialog_FontChooser { public: XAP_Win32Dialog_FontChooser(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_History.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_History.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_History.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_History.h 2008-07-13 14:09:45.000000000 +0100 @@ -27,7 +27,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_History: public XAP_Dialog_History +class ABI_EXPORT XAP_Win32Dialog_History: public XAP_Dialog_History { public: XAP_Win32Dialog_History(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_HTMLOptions.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_HTMLOptions.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_HTMLOptions.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_HTMLOptions.h 2008-07-13 14:09:45.000000000 +0100 @@ -27,7 +27,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_HTMLOptions : public XAP_Win32DialogBase, public XAP_Dialog_HTMLOptions +class ABI_EXPORT XAP_Win32Dialog_HTMLOptions : public XAP_Win32DialogBase, public XAP_Dialog_HTMLOptions { public: XAP_Win32Dialog_HTMLOptions(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Image.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Image.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Image.h 2008-04-06 16:59:59.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Image.h 2008-07-13 14:09:46.000000000 +0100 @@ -26,7 +26,7 @@ class XAP_Frame; /*****************************************************************/ -class XAP_Win32Dialog_Image: public XAP_Win32DialogBase, public XAP_Dialog_Image +class ABI_EXPORT XAP_Win32Dialog_Image: public XAP_Win32DialogBase, public XAP_Dialog_Image { public: XAP_Win32Dialog_Image(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Insert_Symbol.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Insert_Symbol.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Insert_Symbol.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Insert_Symbol.h 2008-07-13 14:09:45.000000000 +0100 @@ -35,7 +35,7 @@ static char Symbol_font_selected[32] = "Symbol"; -class XAP_Draw_Symbol_sample : public XAP_Preview +class ABI_EXPORT XAP_Draw_Symbol_sample : public XAP_Preview { public: @@ -59,7 +59,7 @@ -class XAP_Win32Dialog_Insert_Symbol: public XAP_Win32DialogBase, public XAP_Dialog_Insert_Symbol +class ABI_EXPORT XAP_Win32Dialog_Insert_Symbol: public XAP_Win32DialogBase, public XAP_Dialog_Insert_Symbol { public: XAP_Win32Dialog_Insert_Symbol(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Language.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Language.cpp --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Language.cpp 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Language.cpp 2008-07-13 14:09:45.000000000 +0100 @@ -301,6 +301,7 @@ { bool b = (IsDlgButtonChecked(hWnd,XAP_RID_DIALOG_LANGUAGE_DOCLANG_CHKBOX)==BST_CHECKED); setMakeDocumentDefault(b); + return 1; } default: // we did not handle this notification diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Language.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Language.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Language.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Language.h 2008-07-13 14:09:46.000000000 +0100 @@ -26,7 +26,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_Language: public XAP_Dialog_Language +class ABI_EXPORT XAP_Win32Dialog_Language: public XAP_Dialog_Language { public: XAP_Win32Dialog_Language(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_ListDocuments.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_ListDocuments.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_ListDocuments.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_ListDocuments.h 2008-07-13 14:09:45.000000000 +0100 @@ -27,7 +27,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_ListDocuments: public XAP_Dialog_ListDocuments +class ABI_EXPORT XAP_Win32Dialog_ListDocuments: public XAP_Dialog_ListDocuments { public: XAP_Win32Dialog_ListDocuments(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_MessageBox.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_MessageBox.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_MessageBox.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_MessageBox.h 2008-07-13 14:09:46.000000000 +0100 @@ -25,7 +25,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_MessageBox : public XAP_Dialog_MessageBox +class ABI_EXPORT XAP_Win32Dialog_MessageBox : public XAP_Dialog_MessageBox { public: XAP_Win32Dialog_MessageBox(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Password.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Password.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Password.h 2008-04-06 16:59:59.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Password.h 2008-07-13 14:09:47.000000000 +0100 @@ -29,7 +29,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_Password: public XAP_Win32DialogBase, public XAP_Dialog_Password +class ABI_EXPORT XAP_Win32Dialog_Password: public XAP_Win32DialogBase, public XAP_Dialog_Password { public: XAP_Win32Dialog_Password(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_PluginManager.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_PluginManager.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_PluginManager.h 2008-04-06 16:59:59.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_PluginManager.h 2008-07-13 14:09:46.000000000 +0100 @@ -27,7 +27,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_PluginManager: public XAP_Win32DialogBase, public XAP_Dialog_PluginManager +class ABI_EXPORT XAP_Win32Dialog_PluginManager: public XAP_Win32DialogBase, public XAP_Dialog_PluginManager { public: XAP_Win32Dialog_PluginManager(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Print.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Print.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Print.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Print.h 2008-07-13 14:09:46.000000000 +0100 @@ -26,7 +26,7 @@ #include /*****************************************************************/ -class XAP_Win32Dialog_Print : public XAP_Dialog_Print +class ABI_EXPORT XAP_Win32Dialog_Print : public XAP_Dialog_Print { public: XAP_Win32Dialog_Print(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_PrintPreview.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_PrintPreview.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_PrintPreview.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_PrintPreview.h 2008-07-13 14:09:46.000000000 +0100 @@ -25,7 +25,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_PrintPreview : public XAP_Dialog_PrintPreview +class ABI_EXPORT XAP_Win32Dialog_PrintPreview : public XAP_Dialog_PrintPreview { public: XAP_Win32Dialog_PrintPreview(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Stub.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Stub.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Stub.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Stub.h 2008-07-13 14:09:45.000000000 +0100 @@ -25,7 +25,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_Stub: public XAP_Dialog_Stub +class ABI_EXPORT XAP_Win32Dialog_Stub: public XAP_Dialog_Stub { public: XAP_Win32Dialog_Stub(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_WindowMore.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_WindowMore.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_WindowMore.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_WindowMore.h 2008-07-13 14:09:45.000000000 +0100 @@ -26,7 +26,7 @@ class XAP_Frame; /*****************************************************************/ -class XAP_Win32Dialog_WindowMore: public XAP_Win32DialogBase, public XAP_Dialog_WindowMore +class ABI_EXPORT XAP_Win32Dialog_WindowMore: public XAP_Win32DialogBase, public XAP_Dialog_WindowMore { public: XAP_Win32Dialog_WindowMore(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Zoom.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Zoom.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Dlg_Zoom.h 2008-04-06 16:59:59.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Dlg_Zoom.h 2008-07-13 14:09:46.000000000 +0100 @@ -28,7 +28,7 @@ /*****************************************************************/ -class XAP_Win32Dialog_Zoom: public XAP_Win32DialogBase, public XAP_Dialog_Zoom +class ABI_EXPORT XAP_Win32Dialog_Zoom: public XAP_Win32DialogBase, public XAP_Dialog_Zoom { public: XAP_Win32Dialog_Zoom(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32EncodingManager.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32EncodingManager.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32EncodingManager.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32EncodingManager.h 2008-07-13 14:09:46.000000000 +0100 @@ -4,7 +4,7 @@ #include "xap_EncodingManager.h" /* it's assumed that only one instance of this class will exist */ -class XAP_Win32EncodingManager: public XAP_EncodingManager +class ABI_EXPORT XAP_Win32EncodingManager: public XAP_EncodingManager { protected: XAP_Win32EncodingManager(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32FontPreview.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32FontPreview.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32FontPreview.h 2008-04-06 16:59:59.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32FontPreview.h 2008-07-13 14:09:46.000000000 +0100 @@ -26,7 +26,7 @@ class GR_Win32Graphics; -class XAP_Win32FontPreview : public XAP_FontPreview +class ABI_EXPORT XAP_Win32FontPreview : public XAP_FontPreview { public: XAP_Win32FontPreview(XAP_Frame * pFrame, UT_sint32 left, UT_uint32 top); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Module.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Module.cpp --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Module.cpp 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Module.cpp 2008-07-13 14:09:46.000000000 +0100 @@ -35,7 +35,7 @@ static const char szErrAlreadyLoaded[] = "Library already loaded"; static const char szErrCouldNotUnload[] = "Could not unload library"; -class XAP_Win32ModuleImpl +class ABI_EXPORT XAP_Win32ModuleImpl { public: XAP_Win32ModuleImpl() : m_hMod(0), m_pszErr(0), m_pszModuleName(0) { } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Module.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Module.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Module.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Module.h 2008-07-13 14:09:46.000000000 +0100 @@ -18,8 +18,8 @@ * 02111-1307, USA. */ -#ifndef XAP_UNIXMODULE_H -#define XAP_UNIXMODULE_H +#ifndef XAP_WIN32MODULE_H +#define XAP_WIN32MODULE_H #include "xap_Module.h" @@ -28,7 +28,7 @@ Implements the XAP_Module interface. */ -class XAP_Win32Module : public XAP_Module +class ABI_EXPORT XAP_Win32Module : public XAP_Module { friend class XAP_ModuleManager; @@ -49,4 +49,4 @@ class XAP_Win32ModuleImpl* pimpl; }; -#endif /* XAP_UNIXMODULE_H */ +#endif /* XAP_WIN32MODULE_H */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32PreviewWidget.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32PreviewWidget.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32PreviewWidget.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32PreviewWidget.h 2008-07-13 14:09:45.000000000 +0100 @@ -36,7 +36,7 @@ ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// -class XAP_Win32PreviewWidget +class ABI_EXPORT XAP_Win32PreviewWidget { public: XAP_Win32PreviewWidget(XAP_Win32App * pWin32App, diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32PropertySheet.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32PropertySheet.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32PropertySheet.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32PropertySheet.h 2008-07-13 14:09:46.000000000 +0100 @@ -39,7 +39,7 @@ #define ID_APPLY_NOW 0x3021 -class XAP_Win32PropertyPage +class ABI_EXPORT XAP_Win32PropertyPage { public: @@ -73,7 +73,7 @@ }; -class XAP_Win32PropertySheet +class ABI_EXPORT XAP_Win32PropertySheet { public: XAP_Win32PropertySheet(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Slurp.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Slurp.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Slurp.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Slurp.h 2008-07-13 14:09:46.000000000 +0100 @@ -21,7 +21,7 @@ #include class XAP_Win32APP; -class XAP_Win32Slurp +class ABI_EXPORT XAP_Win32Slurp { public: XAP_Win32Slurp(XAP_Win32App * pApp); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32_TB_CFactory.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32_TB_CFactory.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32_TB_CFactory.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32_TB_CFactory.h 2008-07-13 14:09:45.000000000 +0100 @@ -22,7 +22,7 @@ #include "xap_Toolbar_ControlFactory.h" -class AP_Win32Toolbar_ControlFactory : public XAP_Toolbar_ControlFactory +class ABI_EXPORT AP_Win32Toolbar_ControlFactory : public XAP_Toolbar_ControlFactory { public: AP_Win32Toolbar_ControlFactory(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Toolbar_Icons.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Toolbar_Icons.h --- abiword-2.6.2/abiword/src/af/xap/win/xap_Win32Toolbar_Icons.h 2008-04-06 16:59:58.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/win/xap_Win32Toolbar_Icons.h 2008-07-13 14:09:45.000000000 +0100 @@ -27,7 +27,7 @@ /*****************************************************************/ -class AP_Win32Toolbar_Icons : public AP_Toolbar_Icons +class ABI_EXPORT AP_Win32Toolbar_Icons : public AP_Toolbar_Icons { public: AP_Win32Toolbar_Icons(void); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xad_Document.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xad_Document.h --- abiword-2.6.2/abiword/src/af/xap/xp/xad_Document.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xad_Document.h 2008-07-13 14:09:43.000000000 +0100 @@ -44,7 +44,7 @@ class AV_View; // a helper class for history tracking -class AD_VersionData +class ABI_EXPORT AD_VersionData { public: @@ -94,7 +94,7 @@ // a helper class for keeping track of revisions in the document -class AD_Revision +class ABI_EXPORT AD_Revision { public: AD_Revision(UT_uint32 iId, UT_UCS4Char * pDesc, time_t start, UT_uint32 iVer = 0) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_App.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_App.cpp --- abiword-2.6.2/abiword/src/af/xap/xp/xap_App.cpp 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_App.cpp 2008-07-13 14:09:43.000000000 +0100 @@ -24,6 +24,7 @@ #include #include +#include #include #include "ut_types.h" @@ -302,6 +303,8 @@ bool XAP_App::initialize(const char * szKeyBindingsKey, const char * szKeyBindingsDefaultValue) { + if (!g_thread_supported ()) + g_thread_init (NULL); gsf_init(); // create application-wide resources that diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_AppImpl.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_AppImpl.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_AppImpl.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_AppImpl.h 2008-07-13 14:09:42.000000000 +0100 @@ -21,10 +21,18 @@ #ifndef _XAP_APP_IMPL_H_ #define _XAP_APP_IMPL_H_ +/* pre-emptive dismissal; ut_types.h is needed by just about everything, + * so even if it's commented out in-file that's still a lot of work for + * the preprocessor to do... + */ +#ifndef UT_TYPES_H +#include "ut_types.h" +#endif + class UT_String; -class XAP_AppImpl +class ABI_EXPORT XAP_AppImpl { public: virtual ~XAP_AppImpl() {} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Args.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Args.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Args.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Args.h 2008-07-13 14:09:43.000000000 +0100 @@ -28,7 +28,7 @@ #include "ut_types.h" #endif -class XAP_Args +class ABI_EXPORT XAP_Args { public: XAP_Args(int argc, const char ** argv); /* for systems which cut up the command line for us */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dialog.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dialog.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dialog.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dialog.h 2008-07-13 14:09:43.000000000 +0100 @@ -259,7 +259,7 @@ { public: - class Page { + class ABI_EXPORT Page { public: Page() {} Page(const gchar *title, AbiNativeWidget * widget) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_About.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_About.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_About.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_About.h 2008-07-13 14:09:43.000000000 +0100 @@ -20,6 +20,14 @@ #ifndef XAP_DIALOG_ABOUT_H #define XAP_DIALOG_ABOUT_H +/* pre-emptive dismissal; ut_types.h is needed by just about everything, + * so even if it's commented out in-file that's still a lot of work for + * the preprocessor to do... + */ +#ifndef UT_TYPES_H +#include "ut_types.h" +#endif + #include "xap_Dialog.h" #include "xav_View.h" @@ -62,7 +70,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \ GNU General Public License for more details." -class XAP_Dialog_About : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_About : public XAP_Dialog_NonPersistent { public: XAP_Dialog_About(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_ClipArt.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_ClipArt.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_ClipArt.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_ClipArt.h 2008-07-13 14:09:42.000000000 +0100 @@ -26,7 +26,7 @@ class XAP_Frame; -class XAP_Dialog_ClipArt : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_ClipArt : public XAP_Dialog_NonPersistent { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_DocComparison.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_DocComparison.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_DocComparison.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_DocComparison.h 2008-07-13 14:09:42.000000000 +0100 @@ -54,7 +54,7 @@ const UT_uint32 iResultCount = 4; -class XAP_Dialog_DocComparison : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_DocComparison : public XAP_Dialog_NonPersistent { public: XAP_Dialog_DocComparison(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Encoding.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Encoding.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Encoding.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Encoding.h 2008-07-13 14:09:43.000000000 +0100 @@ -49,7 +49,7 @@ -class XAP_Dialog_Encoding : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_Encoding : public XAP_Dialog_NonPersistent { public: typedef enum { a_OK, a_CANCEL, a_YES, a_NO } tAnswer; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_FontChooser.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_FontChooser.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_FontChooser.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_FontChooser.h 2008-07-13 14:09:43.000000000 +0100 @@ -38,7 +38,7 @@ class GR_Graphics; -class XAP_Preview_FontPreview : public XAP_Preview +class ABI_EXPORT XAP_Preview_FontPreview : public XAP_Preview { public: explicit XAP_Preview_FontPreview(GR_Graphics * gc, const gchar * pszClrBackgound); @@ -70,7 +70,7 @@ /*****************************************************************/ -class XAP_Dialog_FontChooser : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_FontChooser : public XAP_Dialog_NonPersistent { public: XAP_Dialog_FontChooser(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_History.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_History.cpp --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_History.cpp 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_History.cpp 2008-07-13 14:09:42.000000000 +0100 @@ -114,17 +114,35 @@ tT = pUUID->getTime(); tM = localtime(&tT); s = (char*)g_try_malloc(30); - strftime(s,30,"%c",tM); + if(!s) + return NULL; + + size_t len = strftime(s,30,"%c",tM); + if(!len) + { + FREEP(s); + return NULL; + } + return s; } case 3: - tT = m_pDoc->getLastSavedTime(); - tM = localtime(&tT); - s = (char*)g_try_malloc(30); - strftime(s,30,"%c",tM); - return s; + { + tT = m_pDoc->getLastSavedTime(); + tM = localtime(&tT); + s = (char*)g_try_malloc(30); + if(!s) + return NULL; + size_t len = strftime(s,30,"%c",tM); + if(!len) + { + FREEP(s); + return NULL; + } + return s; + } case 4: { UT_uint32 iEditTime = m_pDoc->getEditTime(); @@ -205,11 +223,22 @@ return g_strdup(S.c_str()); case 1: - tT = m_pDoc->getHistoryNthTimeStarted(item); - tM = localtime(&tT); - s = (char*)g_try_malloc(30); - strftime(s,30,"%c",tM); - return s; + { + tT = m_pDoc->getHistoryNthTimeStarted(item); + tM = localtime(&tT); + s = (char*)g_try_malloc(30); + if(!s) + return NULL; + + size_t len = strftime(s,30,"%c",tM); + if(!len) + { + FREEP(s); + return NULL; + } + + return s; + } case 2: { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_History.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_History.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_History.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_History.h 2008-07-13 14:09:44.000000000 +0100 @@ -59,7 +59,7 @@ const UT_uint32 iButtonCount = 2; const UT_uint32 iListColumnCount = 3; -class XAP_Dialog_History : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_History : public XAP_Dialog_NonPersistent { public: XAP_Dialog_History(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_HTMLOptions.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_HTMLOptions.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_HTMLOptions.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_HTMLOptions.h 2008-07-13 14:09:43.000000000 +0100 @@ -53,7 +53,7 @@ bool bMultipart; }; -class XAP_Dialog_HTMLOptions : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_HTMLOptions : public XAP_Dialog_NonPersistent { public: XAP_Dialog_HTMLOptions (XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Image.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Image.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Image.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Image.h 2008-07-13 14:09:44.000000000 +0100 @@ -51,7 +51,7 @@ /* #include "xav_View.h" */ -class XAP_Dialog_Image : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_Image : public XAP_Dialog_NonPersistent { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Insert_Symbol.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Insert_Symbol.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Insert_Symbol.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Insert_Symbol.h 2008-07-13 14:09:43.000000000 +0100 @@ -31,7 +31,7 @@ class XAP_Frame; class XAP_Draw_Symbol; -class XAP_Insert_symbol_listener +class ABI_EXPORT XAP_Insert_symbol_listener { public: virtual ~XAP_Insert_symbol_listener() {} @@ -40,7 +40,7 @@ virtual bool insertSymbol(UT_UCSChar Char, const char *p_font_name) = 0; }; -class XAP_Dialog_Insert_Symbol : public XAP_Dialog_Modeless +class ABI_EXPORT XAP_Dialog_Insert_Symbol : public XAP_Dialog_Modeless { public: XAP_Dialog_Insert_Symbol(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_ListDocuments.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_ListDocuments.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_ListDocuments.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_ListDocuments.h 2008-07-13 14:09:43.000000000 +0100 @@ -58,7 +58,7 @@ */ -class XAP_Dialog_ListDocuments : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_ListDocuments : public XAP_Dialog_NonPersistent { public: XAP_Dialog_ListDocuments(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_MessageBox.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_MessageBox.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_MessageBox.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_MessageBox.h 2008-07-13 14:09:44.000000000 +0100 @@ -23,7 +23,7 @@ #include "xap_Dialog.h" #include "xap_Strings.h" -class XAP_Dialog_MessageBox : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_MessageBox : public XAP_Dialog_NonPersistent { public: XAP_Dialog_MessageBox(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Password.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Password.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Password.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Password.h 2008-07-13 14:09:44.000000000 +0100 @@ -28,7 +28,7 @@ class XAP_Frame; -class XAP_Dialog_Password : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_Password : public XAP_Dialog_NonPersistent { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_PluginManager.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_PluginManager.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_PluginManager.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_PluginManager.h 2008-07-13 14:09:44.000000000 +0100 @@ -34,7 +34,7 @@ // todo: it makes sense to make me modeless -class XAP_Dialog_PluginManager : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_PluginManager : public XAP_Dialog_NonPersistent { public: XAP_Dialog_PluginManager (XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Print.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Print.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Print.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Print.h 2008-07-13 14:09:43.000000000 +0100 @@ -26,7 +26,7 @@ /*****************************************************************/ -class XAP_Dialog_Print : public XAP_Dialog_AppPersistent +class ABI_EXPORT XAP_Dialog_Print : public XAP_Dialog_AppPersistent { public: XAP_Dialog_Print(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_PrintPreview.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_PrintPreview.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_PrintPreview.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_PrintPreview.h 2008-07-13 14:09:43.000000000 +0100 @@ -30,7 +30,7 @@ /*****************************************************************/ -class XAP_Dialog_PrintPreview : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_PrintPreview : public XAP_Dialog_NonPersistent { public: XAP_Dialog_PrintPreview(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Stub.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Stub.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Stub.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Stub.h 2008-07-13 14:09:44.000000000 +0100 @@ -40,7 +40,7 @@ *much* better off stealing code from another existing dialog which does something real. */ -class XAP_Dialog_Stub : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_Stub : public XAP_Dialog_NonPersistent { public: XAP_Dialog_Stub(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_WindowMore.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_WindowMore.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_WindowMore.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_WindowMore.h 2008-07-13 14:09:43.000000000 +0100 @@ -25,7 +25,7 @@ class XAP_Frame; -class XAP_Dialog_WindowMore : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_WindowMore : public XAP_Dialog_NonPersistent { public: XAP_Dialog_WindowMore(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Zoom.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Zoom.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Dlg_Zoom.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Dlg_Zoom.h 2008-07-13 14:09:43.000000000 +0100 @@ -32,7 +32,7 @@ #define XAP_DLG_ZOOM_MAXIMUM_ZOOM 500 // arbitrary value (percentage) #define XAP_DLG_ZOOM_MINIMUM_ZOOM 20 // arbitrary value (percentage) -class XAP_Dialog_Zoom : public XAP_Dialog_NonPersistent +class ABI_EXPORT XAP_Dialog_Zoom : public XAP_Dialog_NonPersistent { public: XAP_Dialog_Zoom(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Draw_Symbol.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Draw_Symbol.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Draw_Symbol.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Draw_Symbol.h 2008-07-13 14:09:43.000000000 +0100 @@ -34,7 +34,7 @@ class GR_Font; -class XAP_Draw_Symbol : public XAP_Preview +class ABI_EXPORT XAP_Draw_Symbol : public XAP_Preview { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_FakeClipboard.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_FakeClipboard.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_FakeClipboard.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_FakeClipboard.h 2008-07-13 14:09:43.000000000 +0100 @@ -33,7 +33,7 @@ struct _ClipboardItem; -class XAP_FakeClipboard +class ABI_EXPORT XAP_FakeClipboard { public: XAP_FakeClipboard(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_FontPreview.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_FontPreview.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_FontPreview.h 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_FontPreview.h 2008-07-13 14:09:43.000000000 +0100 @@ -32,7 +32,7 @@ #define PREVIEW_WIDTH 400 #define PREVIEW_HEIGHT 75 -class XAP_FontPreview +class ABI_EXPORT XAP_FontPreview { public: XAP_FontPreview(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_LoadBindings.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_LoadBindings.h --- abiword-2.6.2/abiword/src/af/xap/xp/xap_LoadBindings.h 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_LoadBindings.h 2008-07-13 14:09:43.000000000 +0100 @@ -26,7 +26,7 @@ /*****************************************************************/ -class XAP_BindingSet +class ABI_EXPORT XAP_BindingSet { public: XAP_BindingSet(EV_EditMethodContainer * pemc); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Log.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Log.cpp --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Log.cpp 2008-04-06 16:59:56.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Log.cpp 2008-07-13 14:09:43.000000000 +0100 @@ -7,7 +7,7 @@ XAP_Log *XAP_Log::m_pInstance = 0; -class XAP_LogDestructor +class ABI_EXPORT XAP_LogDestructor { public: XAP_LogDestructor() : t_(0) {} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/src/af/xap/xp/xap_Prefs.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword/src/af/xap/xp/xap_Prefs.cpp --- abiword-2.6.2/abiword/src/af/xap/xp/xap_Prefs.cpp 2008-04-06 16:59:55.000000000 +0100 +++ abiword-2.6.4/abiword/src/af/xap/xp/xap_Prefs.cpp 2008-07-13 14:09:43.000000000 +0100 @@ -446,6 +446,7 @@ case Error: *s += "error: "; + break; case Log: default: *s += "message: "; @@ -1495,7 +1496,7 @@ "\t @@ -17,9 +17,9 @@ - - - + + +
diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/user/wp/strings/pt-BR.strings /tmp/qY2gb79Nml/abiword-2.6.4/abiword/user/wp/strings/pt-BR.strings --- abiword-2.6.2/abiword/user/wp/strings/pt-BR.strings 2008-04-06 17:00:56.000000000 +0100 +++ abiword-2.6.4/abiword/user/wp/strings/pt-BR.strings 2008-07-13 14:10:57.000000000 +0100 @@ -954,7 +954,7 @@ DLG_Styles_ErrBlankName="O nome do estilo no pode ficar em branco" DLG_Styles_ErrNoStyle="Para modificar um estilo tem de o selecionar primeiro" DLG_Styles_ErrNotTitle1="Nome do Estilo - " -DLG_Styles_ErrNotTitle2="Reservado. No pode usar este nome. Escolha outro " +DLG_Styles_ErrNotTitle2=" - Reservado. No pode usar este nome. Escolha outro " DLG_Styles_ErrStyleBuiltin="No pode modificar um estilo base." DLG_Styles_ErrStyleCantDelete="No possvel apagar este estilo." DLG_Styles_ErrStyleNot="Este estilo no existe e por isso no pode ser modificado" @@ -1112,10 +1112,10 @@ MENU_LABEL_EDIT_COPY_FRAME="Copiar Caixa de Texto" MENU_LABEL_EDIT_COPY_HYPERLINK_LOCATION="C&opia localizao de hiperlink" MENU_LABEL_EDIT_CUT="Co&rtar" -MENU_LABEL_EDIT_CUTEMBED="Definir" +MENU_LABEL_EDIT_CUTEMBED="Remover Objeto" MENU_LABEL_EDIT_CUTIMAGE="Remover Imagem" MENU_LABEL_EDIT_CUT_FRAME="Remover Caixa de Texto" -MENU_LABEL_EDIT_DELETEEMBED="Apagar &Tabela" +MENU_LABEL_EDIT_DELETEEMBED="Apagar Objeto" MENU_LABEL_EDIT_DELETEFRAME="Remover Caixa de Texto" MENU_LABEL_EDIT_DELETEIMAGE="Remover Imagem" MENU_LABEL_EDIT_EDITFOOTER="Editar &Rodap" @@ -1174,7 +1174,7 @@ MENU_LABEL_FMT_DIRECTION_DO_LTR="Texto no sentido &esquerda para a direita" MENU_LABEL_FMT_DIRECTION_DO_RTL="Texto no sentido &direita para esquerda" MENU_LABEL_FMT_DOCUMENT="&Documento" -MENU_LABEL_FMT_EMBED="Formatar Tabela" +MENU_LABEL_FMT_EMBED="Formatar Objeto" MENU_LABEL_FMT_FONT="&Tipo" MENU_LABEL_FMT_FOOTNOTES="Formatar Notas de Rodap e do Final" MENU_LABEL_FMT_FRAME="Caixa de Texto" @@ -1188,7 +1188,7 @@ MENU_LABEL_FMT_SETPOSIMAGE="Colocar Imagem Posicionada" MENU_LABEL_FMT_STRIKE="&Riscar" MENU_LABEL_FMT_STYLE="&Estilo" -MENU_LABEL_FMT_STYLE_DEFINE="&Criar e Modificar" +MENU_LABEL_FMT_STYLE_DEFINE="&Criar e Modificar Estilos" MENU_LABEL_FMT_STYLIST="" MENU_LABEL_FMT_SUBSCRIPT="n&dice" MENU_LABEL_FMT_SUPERSCRIPT="&Expoente" @@ -1361,14 +1361,14 @@ MENU_LABEL_WINDOW_9="&9 %s" MENU_LABEL_WINDOW_MORE="&Mais janelas" MENU_LABEL_WINDOW_NEW="&Nova" -MENU_LABEL__BOGUS1__="Fechar documento" -MENU_LABEL__BOGUS2__="Fechar documento" -MENU_STATUSLINE_ALIGN="Fechar documento" +MENU_LABEL__BOGUS1__=" " +MENU_LABEL__BOGUS2__=" " +MENU_STATUSLINE_ALIGN=" " MENU_STATUSLINE_ALIGN_CENTER="Centralizar texto" MENU_STATUSLINE_ALIGN_JUSTIFY="Justificar texto" MENU_STATUSLINE_ALIGN_LEFT="Alinhar esquerda" MENU_STATUSLINE_ALIGN_RIGHT="Alinhar direita" -MENU_STATUSLINE_EDIT="Fechar documento" +MENU_STATUSLINE_EDIT=" " MENU_STATUSLINE_EDIT_CLEAR="Apagar seleo" MENU_STATUSLINE_EDIT_COPY="Copiar seleo" MENU_STATUSLINE_EDIT_COPYEMBED="Copiar Objeto Embutido" @@ -1395,7 +1395,7 @@ MENU_STATUSLINE_EDIT_SELECTALL="Selecionar todo o documento" MENU_STATUSLINE_EDIT_SELECT_FRAME="Selecionar a Caixa de Texto" MENU_STATUSLINE_EDIT_UNDO="Cancelar ltima ao" -MENU_STATUSLINE_FILE="Fechar documento" +MENU_STATUSLINE_FILE=" " MENU_STATUSLINE_FILE_CLOSE="Fechar documento" MENU_STATUSLINE_FILE_EXIT="Fechar todas as janelas e sair" MENU_STATUSLINE_FILE_EXPORT="Salvar como" @@ -1425,7 +1425,7 @@ MENU_STATUSLINE_FILE_SAVEEMBED="Salvar o Objeto Embutido" MENU_STATUSLINE_FILE_SAVEIMAGE="Salvar a imagem selecionadas para um arquivo" MENU_STATUSLINE_FILE_SAVE_TEMPLATE="Salvar o documento como modelo" -MENU_STATUSLINE_FMT="Fechar documento" +MENU_STATUSLINE_FMT=" " MENU_STATUSLINE_FMT_BACKGROUND="Mudar cor de fundo" MENU_STATUSLINE_FMT_BACKGROUND_PAGE_COLOR="Mudar a cor de pgina do seu documento" MENU_STATUSLINE_FMT_BACKGROUND_PAGE_IMAGE="Colocar uma imagem como fundo para sua pgina" @@ -1462,8 +1462,8 @@ MENU_STATUSLINE_FMT_TOGGLECASE="Mudar capitalizao da rea seleccionada" MENU_STATUSLINE_FMT_TOPLINE="Colocar/Remover linha acima da seleo" MENU_STATUSLINE_FMT_UNDERLINE="Sublinhar texto" -MENU_STATUSLINE_FORMAT="Fechar documento" -MENU_STATUSLINE_HELP="Fechar documento" +MENU_STATUSLINE_FORMAT=" " +MENU_STATUSLINE_HELP=" " MENU_STATUSLINE_HELP_ABOUT="Ver informaes sobre o programa, nmero de verso e copyrights" MENU_STATUSLINE_HELP_ABOUT_GNOMEOFFICE="Saiba mais sobre o projecto GNOME Office" MENU_STATUSLINE_HELP_CHECKVER="Verificar se h verses atualizadas do AbiWord na Internet" @@ -1472,7 +1472,7 @@ MENU_STATUSLINE_HELP_INDEX="Mostrar o Index da ajuda" MENU_STATUSLINE_HELP_REPORT_BUG="Relatar um erro e ajudar o AbiWord a se tornar um produto melhor" MENU_STATUSLINE_HELP_SEARCH="Pesquisar ajuda sobre..." -MENU_STATUSLINE_INSERT="Fechar documento" +MENU_STATUSLINE_INSERT=" " MENU_STATUSLINE_INSERT_BOOKMARK="Inserir bookmark" MENU_STATUSLINE_INSERT_BREAK="Inserir quebras de pgina, seo..." MENU_STATUSLINE_INSERT_CLIPART="Inserir grficos do portfolio" @@ -1497,7 +1497,7 @@ MENU_STATUSLINE_INSERT_SYMBOL="Inserir caracteres especiais" MENU_STATUSLINE_INSERT_TABLEOFCONTENTS="Inserir um ndice baseado nos Cabealhos" MENU_STATUSLINE_INSERT_TEXTBOX="Inserir uma Caixa de Texto" -MENU_STATUSLINE_OPEN_TEMPLATE="Fechar documento" +MENU_STATUSLINE_OPEN_TEMPLATE=" " MENU_STATUSLINE_SPELL_ADD="Adicionar esta palavra ao dicionrio custumizvel" MENU_STATUSLINE_SPELL_IGNOREALL="Ignorar todas as ocorrncias desta palavra no documento" MENU_STATUSLINE_SPELL_SUGGEST_1="Mudar para a sugesto" @@ -1551,7 +1551,7 @@ MENU_STATUSLINE_TABLE_TEXTTOTABLE="Converter Texto Selectionado em Tabela" MENU_STATUSLINE_TABLE_TEXTTOTABLE_ALL="Dividir em todos os delimitadores de palavras, incluindo espaos" MENU_STATUSLINE_TABLE_TEXTTOTABLE_NOSPACES="Dividir em todos os delimitadores com exceo dos espaos" -MENU_STATUSLINE_TOOLS="Fechar documento" +MENU_STATUSLINE_TOOLS=" " MENU_STATUSLINE_TOOLS_AUTOSPELL="Verificar ortografia do documento automaticamente" MENU_STATUSLINE_TOOLS_HISTORY="Ver histrico do documento corrente" MENU_STATUSLINE_TOOLS_HISTORY_PURGE="Remover cabealho" @@ -1578,10 +1578,10 @@ MENU_STATUSLINE_TOOLS_REVISIONS_SHOW_BEFORE="Mostrar como o documento antes das revises" MENU_STATUSLINE_TOOLS_SCRIPTS="Executar scripts" MENU_STATUSLINE_TOOLS_SPELL="Verificar ortografia do documento agora" -MENU_STATUSLINE_TOOLS_SPELLING="Fechar documento" +MENU_STATUSLINE_TOOLS_SPELLING=" " MENU_STATUSLINE_TOOLS_SPELLPREFS="Definir opes de ortografia" MENU_STATUSLINE_TOOLS_WORDCOUNT="Contar palavras no documento" -MENU_STATUSLINE_VIEW="Fechar documento" +MENU_STATUSLINE_VIEW=" " MENU_STATUSLINE_VIEW_DEFAULT_TB_LAYOUT="Voltar o layout das barra de ferramenta atual para o padro" MENU_STATUSLINE_VIEW_FULLSCREEN="Mostrar somente as pginas" MENU_STATUSLINE_VIEW_HEADFOOT="Editar os cabealhos e rodaps" @@ -1596,7 +1596,7 @@ MENU_STATUSLINE_VIEW_TB_2="Mostrar ou esconder a barra de ferramentas" MENU_STATUSLINE_VIEW_TB_3="Mostrar ou esconder a barra de ferramentas" MENU_STATUSLINE_VIEW_TB_4="Mostrar ou esconder a barra de ferramentas" -MENU_STATUSLINE_VIEW_TOOLBARS="Fechar documento" +MENU_STATUSLINE_VIEW_TOOLBARS=" " MENU_STATUSLINE_VIEW_WEB="Ver documento como pgina WWW" MENU_STATUSLINE_VIEW_ZOOM="Aproximar ou afastar do texto" MENU_STATUSLINE_VIEW_ZOOM_100="Zoom a 100%" @@ -1608,7 +1608,7 @@ MENU_STATUSLINE_VIEW_ZOOM_WIDTH="Zoom largura da pgina" MENU_STATUSLINE_WEB_SAVEASWEB="Ver o documento (antes de imprimir) como uma pgina de WWW" MENU_STATUSLINE_WEB_WEBPREVIEW="Ver o documento (antes de imprimir) como uma pgina de WWW" -MENU_STATUSLINE_WINDOW="Fechar documento" +MENU_STATUSLINE_WINDOW=" " MENU_STATUSLINE_WINDOW_1="Mudar para a primeira janela" MENU_STATUSLINE_WINDOW_2="Mudar para a primeira janela" MENU_STATUSLINE_WINDOW_3="Mudar para a primeira janela" @@ -1620,8 +1620,8 @@ MENU_STATUSLINE_WINDOW_9="Mudar para a primeira janela" MENU_STATUSLINE_WINDOW_MORE="Mostrar lista completa de janelas" MENU_STATUSLINE_WINDOW_NEW="Abrir outra janela para este documento" -MENU_STATUSLINE__BOGUS1__="Fechar documento" -MENU_STATUSLINE__BOGUS2__="Fechar documento" +MENU_STATUSLINE__BOGUS1__=" " +MENU_STATUSLINE__BOGUS2__=" " MSG_AfterRestartNew="Estas alteraes tomaro efeito quando recomear o AbiWord ou quando criar um novo documento." MSG_AutoMerge="Reconciliao automtica" MSG_AutoRevisionOffWarning="Voc tem certeza de que no quer manter o registro completo do histrico? Se voc proceder, poder no ser possver restaurar verses anteriores deste documento." diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/user/wp/strings/zh-CN.strings /tmp/qY2gb79Nml/abiword-2.6.4/abiword/user/wp/strings/zh-CN.strings --- abiword-2.6.2/abiword/user/wp/strings/zh-CN.strings 2008-04-06 17:00:56.000000000 +0100 +++ abiword-2.6.4/abiword/user/wp/strings/zh-CN.strings 2008-07-13 14:10:57.000000000 +0100 @@ -13,6 +13,8 @@ DLG_ABOUT_Title="关于 %s" DLG_Apply="应用" DLG_Break_Insert="插入" +DLG_CLIPART_Error="无法加载美工图案" +DLG_CLIPART_Loading="美工图案" DLG_CLIPART_Title="美工图案" DLG_Cancel="取消" DLG_Close="关闭" @@ -21,7 +23,7 @@ DLG_Delete="删除" DLG_DocComparison_Content="正文:" DLG_DocComparison_Different="差异" -DLG_DocComparison_Diverging="在%S的d%版本后分割" +DLG_DocComparison_Diverging="在%s的%d版本后分割" DLG_DocComparison_DivergingPos="在文件 %d后分割" DLG_DocComparison_DocsCompared="比较后的文件" DLG_DocComparison_Fmt="格式:" @@ -38,6 +40,7 @@ DLG_FOSA_ALLDOCS="全部文件" DLG_FOSA_ALLIMAGES="全部图像文件" DLG_FOSA_ExportTitle="导出文件" +DLG_FOSA_ExtensionDoesNotMatch="给定的文件扩展名与文件类型不匹配。仍然使用这个文件名么?" DLG_FOSA_FileInsertMath="插入MathML文件:" DLG_FOSA_FileInsertObject="插入嵌入对象文件:" DLG_FOSA_FileOpenTypeLabel="打开文件的格式:" @@ -79,7 +82,7 @@ DLG_History_List_Title="版本历史" DLG_History_Path="文件名称:" DLG_History_Version="版本:" -DLG_History_Version_AutoRevisioned="自动修正" +DLG_History_Version_AutoRevisioned="自动修订" DLG_History_Version_Started="创建" DLG_History_Version_Version="版本" DLG_History_WindowLabel="文件历史" @@ -117,7 +120,7 @@ DLG_LISTDOCS_Heading1="从列表中选择文件" DLG_LISTDOCS_Title="已打开文件" DLG_Lists_Box_List="方框列表" -DLG_Lists_Bullet_List="小圆点列表" +DLG_Lists_Bullet_List="项目列表" DLG_Lists_Dashed_List="横线列表" DLG_Lists_Diamond_List="菱形列表" DLG_Lists_Font="字体:" @@ -173,7 +176,7 @@ DLG_Password_Title="请输入密码" DLG_QNXMB_No="否" DLG_QNXMB_Yes="是" -DLG_Remove_Icon="您想把这个图标从工具栏移除吗?" +DLG_Remove_Icon="您想把这个图标从工具栏删除吗?" DLG_Restore="恢复" DLG_Select="选择" DLG_Show="显示" @@ -209,7 +212,7 @@ DLG_UFS_TransparencyCheck="设定不用文本背景颜色" DLG_UFS_UnderlineCheck="下划线" DLG_ULANG_AvailableLanguages="可用的语言" -DLG_ULANG_DefaultLangChkbox="为这份文件设为默认" +DLG_ULANG_DefaultLangChkbox="设为该文件的默认语言" DLG_ULANG_DefaultLangLabel="默认语言:" DLG_ULANG_LangLabel="选译语言:" DLG_ULANG_LangTitle="语言设定" @@ -334,7 +337,11 @@ LANG_AR_SA="阿拉伯文 (沙特阿拉伯)" LANG_AST_ES="阿斯图里文 (西班牙)" LANG_AS_IN="阿萨姆文" +LANG_AYC_BO="艾马拉语 (Oruro)" +LANG_AYM_BO="艾马拉语 (La Paz)" +LANG_AYR="中艾马拉语" LANG_BE_BY="白俄罗斯语" +LANG_BE_LATIN="白俄罗斯语" LANG_BG_BG="保加利亚文" LANG_BN_IN="孟加拉文" LANG_BR_FR="布列塔尼文" @@ -409,8 +416,11 @@ LANG_PA_IN="旁遮普语(Gurmukhi)" LANG_PA_PK="旁遮普语(Shahmukhi)" LANG_PL_PL="波兰文" +LANG_PS="粘贴" LANG_PT_BR="葡萄牙文 (巴西)" LANG_PT_PT="葡萄牙文 (葡萄牙)" +LANG_QUH_BO="盖丘亚语 (3 元音)" +LANG_QUL_BO="盖丘亚语 (5 元音)" LANG_QU_BO="盖丘亚语" LANG_RO_RO="罗马尼亚文" LANG_RU_RU="俄文 (俄罗斯)" @@ -432,6 +442,7 @@ LANG_UR_PK="乌尔都语(巴基斯坦)" LANG_UZ_UZ="乌兹别克语" LANG_VI_VN="越南文" +LANG_WO_SN="沃洛夫语 (塞内加尔)" LANG_YI="意第绪文" LANG_ZH_CN="中文 (中国大陆)" LANG_ZH_HK="中文 (香港)" @@ -446,13 +457,13 @@ MENU_STATUSLINE_TABLE_DELETE="删除" MENU_STATUSLINE_TABLE_INSERT="插入" MENU_STATUSLINE_TABLE_SELECT="选择" -MSG_AutoRevision="自动修正" +MSG_AutoRevision="自动修订" MSG_BuildingDoc="生成文件:" -MSG_HistoryConfirmSave="你应该在继续之前把更变保存到文件,现在保存吗?" -MSG_HistoryNoRestore="AbiWord无法完整的保存版本%d的文件, 因为缺少这个版本信息。" -MSG_HistoryPartRestore1="AbiWord无法完整的保存版本%d的文件, 因为这个版本信息不完全。" +MSG_HistoryConfirmSave="你应该在继续之前把修改保存到文件 %s,现在保存吗?" +MSG_HistoryNoRestore="AbiWord无法恢复到版本%d,因为这个版本信息不存在。" +MSG_HistoryPartRestore1="AbiWord无法完全恢复到版本%d,因为这个版本信息不完全。" MSG_HistoryPartRestore2="能够完整保存的版本是 %d. 你要用这个版本保存吗? 要部分保存版本 %d,选择不。" -MSG_HistoryPartRestore3="不管怎么样都要继续,就按OK" +MSG_HistoryPartRestore3="按OK继续," MSG_HistoryPartRestore4="要退出恢复的尝试,按取消" MSG_ImportingDoc="正在导入文件..." MSG_NoUndo="这个操作没有完成,你确定你要进行吗?" @@ -460,7 +471,7 @@ SPELL_CANTLOAD_DLL="AbiWord无法找到拼写文件 %s.dll 请从http://aspell.net/win32/Aspell下载并安装它" STYLE_BLOCKTEXT="屏蔽文本" STYLE_BOXLIST="方框列表" -STYLE_BULLETLIST="小圆点列表" +STYLE_BULLETLIST="项目列表" STYLE_CHAPHEADING="章标题" STYLE_DASHEDLIST="横线列表" STYLE_DIAMONLIST="菱形列表" @@ -495,6 +506,7 @@ STYLE_TRIANGLELIST="三角列表" STYLE_UPPERCASTELIST="大写英文字母列表" STYLE_UPPERROMANLIST="大写罗马数字列表" +TB_ClearBackground="清除背景颜色" TB_Font_Symbol="符号" TB_InsertNewTable="插入表格" TB_Table="表格 " @@ -574,17 +586,17 @@ DLG_DateTime_AvailableFormats_Capital="可用格式" DLG_DateTime_DateTimeTitle="插入日期与时间" DLG_FR_FindLabel="寻找目标(&N):" -DLG_FR_FindNextButton="寻找下一个(&F)" -DLG_FR_FindTitle="寻找" -DLG_FR_FinishedFind="AbiWord已经搜索完了文档。" -DLG_FR_FinishedReplace="AbiWord已经完成了文档的搜索和%d处替换。" -DLG_FR_MatchCase="大小写须相符(&M)" +DLG_FR_FindNextButton="查找下一个(&F)" +DLG_FR_FindTitle="查找" +DLG_FR_FinishedFind="AbiWord已经完成文档搜索。" +DLG_FR_FinishedReplace="AbiWord已经完成文档搜索和%d处替换。" +DLG_FR_MatchCase="大小写匹配(&M)" DLG_FR_ReplaceAllButton="全部替换(&A)" DLG_FR_ReplaceButton="替换(&R)" DLG_FR_ReplaceTitle="替换" DLG_FR_ReplaceWithLabel="替换为(&P):" -DLG_FR_ReverseFind="反向寻找(&V)" -DLG_FR_WholeWord="全文(&W)" +DLG_FR_ReverseFind="反向查找(&V)" +DLG_FR_WholeWord="整个单词(&W)" DLG_Field_FieldTitle="插入字段" DLG_Field_FieldTitle_Capital="插入字段" DLG_Field_Fields="字段(&F):" @@ -627,7 +639,7 @@ DLG_FormatTOC_DetailsTabPage="空格与页码" DLG_FormatTOC_DetailsTop="标签定义" DLG_FormatTOC_DispStyle="显示样式:" -DLG_FormatTOC_FillStyle="填写样式:" +DLG_FormatTOC_FillStyle="填充样式:" DLG_FormatTOC_General="一般" DLG_FormatTOC_HasHeading="设置标题(&H)" DLG_FormatTOC_HasLabel="带标签(&A)" @@ -635,7 +647,7 @@ DLG_FormatTOC_HeadingText="标题文本(&E):" DLG_FormatTOC_Indent="缩进(&N)" DLG_FormatTOC_InheritLabel="继承标签(&I)" -DLG_FormatTOC_LayoutDetails="页面细节" +DLG_FormatTOC_LayoutDetails="布局细节" DLG_FormatTOC_Level1="1级" DLG_FormatTOC_Level2="2级" DLG_FormatTOC_Level3="3级" @@ -707,14 +719,14 @@ DLG_ListRevisions_Column2Label="日期" DLG_ListRevisions_Column3Label="说明" DLG_ListRevisions_Label1="存在的修订:" -DLG_ListRevisions_LevelZero="(隐藏所有修订)" +DLG_ListRevisions_LevelZero="(显示所有修订)" DLG_ListRevisions_Title="选择修订" DLG_Lists_Align="文本对齐:" -DLG_Lists_Apply_Current="应用至目前列表" +DLG_Lists_Apply_Current="应用至当前列表" DLG_Lists_Arabic_List="阿拉伯列表" DLG_Lists_ButtonFont="字体..." DLG_Lists_Cur_Change_Start="变更目前列表" -DLG_Lists_Current_Font="当前字型" +DLG_Lists_Current_Font="当前字体" DLG_Lists_Current_List_Label="当前列表标签" DLG_Lists_Current_List_Type="当前列表类型" DLG_Lists_Customize="自订列表" @@ -751,9 +763,9 @@ DLG_MailMerge_Insert_No_Colon="字段名称" DLG_MailMerge_MailMergeTitle="插入邮件合并字段" DLG_MailMerge_OpenFile="打开文件(&O)" -DLG_MarkRevisions_Check1Label="继续前一个修正 (number %d)" +DLG_MarkRevisions_Check1Label="继续前一个修订 (number %d)" DLG_MarkRevisions_Check2Label="开始新修订版" -DLG_MarkRevisions_Comment2Label="与修正有关的说明" +DLG_MarkRevisions_Comment2Label="与修订有关的说明" DLG_MarkRevisions_Title="标记修订" DLG_MergeCellsTitle="合并单元格" DLG_MergeCells_Above="向上合并" @@ -774,11 +786,11 @@ DLG_MetaData_TAB_General="一般" DLG_MetaData_TAB_Permission="许可" DLG_MetaData_TAB_Summary="摘要" -DLG_MetaData_Title="文件属性" +DLG_MetaData_Title="文档属性" DLG_NEW_Choose="选择" DLG_NEW_Create="从模板新建文件" DLG_NEW_NoFile="没有文件" -DLG_NEW_Open="打开已存在的文件" +DLG_NEW_Open="打开已有文件" DLG_NEW_StartEmpty="新建空白文件" DLG_NEW_Tab1="文字处理" DLG_NEW_Tab1_FAX1="新建传真" @@ -798,14 +810,14 @@ DLG_Options_Label_Both="文字和图标" DLG_Options_Label_CheckAllowCustomToolbars="允许自订工具栏" DLG_Options_Label_CheckAutoLoadPlugins="自动加载所有找到的插件" -DLG_Options_Label_CheckEnableSmoothScrolling="启动平滑滚动" +DLG_Options_Label_CheckEnableSmoothScrolling="启用平滑滚动" DLG_Options_Label_CheckWhiteForTransparent="允许白色以外的屏幕颜色" DLG_Options_Label_ChooseForTransparent="选择屏幕颜色" DLG_Options_Label_ColorChooserLabel="选择 AbiWord 的屏幕颜色" DLG_Options_Label_CustomDict="custom.dic" DLG_Options_Label_DefaultPageSize="预设页面大小" DLG_Options_Label_DirectionRtl="预设文字左右方向" -DLG_Options_Label_Documents="文件" +DLG_Options_Label_Documents="文档" DLG_Options_Label_FileExtension="文件扩展:" DLG_Options_Label_General="一般" DLG_Options_Label_Grammar="自动检查语法" @@ -814,19 +826,18 @@ DLG_Options_Label_Hide="隐藏" DLG_Options_Label_Icons="图标" DLG_Options_Label_Ignore="略过" -DLG_Options_Label_InvalidRangeForAutoSave="你应该在1到120之间选择自动保存的频率" +DLG_Options_Label_InvalidRangeForAutoSave="自动保存的频率应该在1到120之间" DLG_Options_Label_LangSettings="语言设定" DLG_Options_Label_Language="语言" -DLG_Options_Label_Layout="页面设置" +DLG_Options_Label_Layout="页面布局" DLG_Options_Label_Look="按钮样式" DLG_Options_Label_Minutes="分钟" DLG_Options_Label_PrefsAutoSave="自动保存这个方案(&A)" DLG_Options_Label_PrefsCurrentScheme="目前偏好的方案(&C)" DLG_Options_Label_Schemes="偏好设定方案" -DLG_Options_Label_ShowSplash="程序启动时显示 AbiWord 欢迎画面" DLG_Options_Label_SmartQuotesEnable="启用智能引号(&E)" -DLG_Options_Label_SpellAutoReplace="自动修改拼错了的单词" -DLG_Options_Label_SpellCheckAsType="自动拼写检查(&P)" +DLG_Options_Label_SpellAutoReplace="自动替换拼错了的单词" +DLG_Options_Label_SpellCheckAsType="输入时拼写检查(&P)" DLG_Options_Label_SpellCustomDict="自订词典:" DLG_Options_Label_SpellDictionaries="词典" DLG_Options_Label_SpellHideErrors="隐藏文件中的拼写错误(&S)" @@ -891,7 +902,7 @@ DLG_PageSetup_Page="页面" DLG_PageSetup_Paper="纸张..." DLG_PageSetup_Paper_Size="纸张大小(&Z):" -DLG_PageSetup_Percent="正常大小的%" +DLG_PageSetup_Percent="正常大小的 %" DLG_PageSetup_Portrait="直印(&P)" DLG_PageSetup_Right="右(&R):" DLG_PageSetup_Scale="比例缩放..." @@ -964,7 +975,7 @@ DLG_Styles_ErrBlankName="样式名称不能留空" DLG_Styles_ErrNoStyle="未选择样式 所以不能修改" DLG_Styles_ErrNotTitle1="样式名称 - " -DLG_Styles_ErrNotTitle2=" - 已保留。 您不能用这个名称。请选择另一个。 " +DLG_Styles_ErrNotTitle2=" - 已保留。 您不能使用这个名称。请选择另一个。 " DLG_Styles_ErrStyleBuiltin="不能修改内定的样式" DLG_Styles_ErrStyleCantDelete="不能删除这个样式" DLG_Styles_ErrStyleNot="这个样式不存在 所以不能修改" @@ -991,13 +1002,13 @@ DLG_Styles_New="新增..." DLG_Styles_NewTitle="新样式" DLG_Styles_ParaPrev="段落预览" -DLG_Styles_RemoveButton="移除" -DLG_Styles_RemoveLab="从样式中移除属性" +DLG_Styles_RemoveButton="删除" +DLG_Styles_RemoveLab="从样式中删除属性" DLG_Styles_StylesLocked="禁止除样式以外的所有格式命令" DLG_Styles_StylesTitle="样式" DLG_Stylist_FootnoteStyles="注释样式" DLG_Stylist_HeadingStyles="标题样式" -DLG_Stylist_ListStyles="样式列表" +DLG_Stylist_ListStyles="列表样式" DLG_Stylist_MiscStyles="其它样式" DLG_Stylist_Styles="样式" DLG_Stylist_Title="样式" @@ -1098,7 +1109,7 @@ FIELD_PieceTable_MartinTest="边界测试" FIELD_PieceTable_Test="Kevins 测试" FIELD_Type_Datetime="日期及时间" -FIELD_Type_Document="文件" +FIELD_Type_Document="文档" FIELD_Type_Numbers="数字" FIELD_Type_PieceTable="表格" FirstLineIndentStatus="第一行缩进 [%s]" @@ -1120,7 +1131,7 @@ MENU_LABEL_EDIT_COPYEMBED="复制对象" MENU_LABEL_EDIT_COPYIMAGE="复制图像" MENU_LABEL_EDIT_COPY_FRAME="复制文本框" -MENU_LABEL_EDIT_COPY_HYPERLINK_LOCATION="复制超级链接的地址(&O)" +MENU_LABEL_EDIT_COPY_HYPERLINK_LOCATION="复制超链接的地址(&O)" MENU_LABEL_EDIT_CUT="剪切(&T)" MENU_LABEL_EDIT_CUTEMBED="剪切对象" MENU_LABEL_EDIT_CUTIMAGE="剪切图像" @@ -1130,14 +1141,14 @@ MENU_LABEL_EDIT_DELETEIMAGE="删除图像" MENU_LABEL_EDIT_EDITFOOTER="编辑页脚" MENU_LABEL_EDIT_EDITHEADER="编辑页眉" -MENU_LABEL_EDIT_FIND="寻找(&F)" +MENU_LABEL_EDIT_FIND="查找(&F)" MENU_LABEL_EDIT_GOTO="转到(&G)" MENU_LABEL_EDIT_LATEXEQUATION="编辑公式" MENU_LABEL_EDIT_PASTE="粘贴(&P)" MENU_LABEL_EDIT_PASTE_SPECIAL="无格式粘贴(&S)" MENU_LABEL_EDIT_REDO="重做(&R)" -MENU_LABEL_EDIT_REMOVEFOOTER="移除页脚" -MENU_LABEL_EDIT_REMOVEHEADER="移除页眉" +MENU_LABEL_EDIT_REMOVEFOOTER="删除页脚" +MENU_LABEL_EDIT_REMOVEHEADER="删除页眉" MENU_LABEL_EDIT_REPLACE="替换(&E)" MENU_LABEL_EDIT_SELECTALL="全选" MENU_LABEL_EDIT_SELECT_FRAME="选择文本框" @@ -1219,11 +1230,12 @@ MENU_LABEL_HELP_INDEX="帮助介绍(&I)" MENU_LABEL_HELP_REPORT_BUG="报告程序错误(&B)" MENU_LABEL_HELP_SEARCH="搜寻帮助(&S)" +MENU_LABEL_INSERT_ANNOTATION="注解" MENU_LABEL_INSERT_BOOKMARK="书签(&K)" MENU_LABEL_INSERT_BREAK="分隔符(&B)" MENU_LABEL_INSERT_CLIPART="美工图案(&C)" MENU_LABEL_INSERT_DATETIME="日期及时间(&T)" -MENU_LABEL_INSERT_DELETE_HYPERLINK="删除超级链接(&D)" +MENU_LABEL_INSERT_DELETE_HYPERLINK="删除超链接(&D)" MENU_LABEL_INSERT_DIRECTIONMARKER="文本方向标记(&D)" MENU_LABEL_INSERT_DIRECTIONMARKER_LRM="从左到右标记(&L)" MENU_LABEL_INSERT_DIRECTIONMARKER_RLM="从右到左标记(&R)" @@ -1239,7 +1251,7 @@ MENU_LABEL_INSERT_GOTO_HYPERLINK="转到超链接(&J)" MENU_LABEL_INSERT_GRAPHIC="图片(&P)" MENU_LABEL_INSERT_HEADER="页眉" -MENU_LABEL_INSERT_HYPERLINK="超级链接(&H)" +MENU_LABEL_INSERT_HYPERLINK="超链接(&H)" MENU_LABEL_INSERT_MAILMERGE="邮件合并域(&M)" MENU_LABEL_INSERT_PAGENO="页码(&U)" MENU_LABEL_INSERT_SYMBOL="符号(&M)" @@ -1258,7 +1270,7 @@ MENU_LABEL_SPELL_SUGGEST_8="%s" MENU_LABEL_SPELL_SUGGEST_9="%s" MENU_LABEL_TABLE="表格(&A)" -MENU_LABEL_TABLE_AUTOFIT="自动填充表格(&A)" +MENU_LABEL_TABLE_AUTOFIT="自动调整表格(&A)" MENU_LABEL_TABLE_DELETE="删除(&D)" MENU_LABEL_TABLE_DELETECOLUMN="删除列(&L)" MENU_LABEL_TABLE_DELETEROW="删除行(&W)" @@ -1269,7 +1281,7 @@ MENU_LABEL_TABLE_DELETE_TABLE="表格(&T)" MENU_LABEL_TABLE_FORMAT="设定表格格式(&F)" MENU_LABEL_TABLE_HEADING_ROWS_REPEAT="重复此行作为标题" -MENU_LABEL_TABLE_HEADING_ROWS_REPEAT_REMOVE="移除标题行" +MENU_LABEL_TABLE_HEADING_ROWS_REPEAT_REMOVE="删除标题行" MENU_LABEL_TABLE_HEADING_ROWS_REPEAT_THIS="把这一行设定为标题" MENU_LABEL_TABLE_INSERTCOLUMN="插入列(&C)" MENU_LABEL_TABLE_INSERTROW="插入行(&R)" @@ -1296,15 +1308,15 @@ MENU_LABEL_TABLE_SPLIT_CELLS="拆分单元格(&P)" MENU_LABEL_TABLE_SPLIT_TABLE="拆分表格(&T)" MENU_LABEL_TABLE_TABLETOTEXT="将表格转换为文本" -MENU_LABEL_TABLE_TABLETOTEXTCOMMAS="以逗号分割" -MENU_LABEL_TABLE_TABLETOTEXTCOMMASTABS="依逗号和标签分割" -MENU_LABEL_TABLE_TABLETOTEXTTABS="依跳格分割" +MENU_LABEL_TABLE_TABLETOTEXTCOMMAS="以逗号分隔" +MENU_LABEL_TABLE_TABLETOTEXTCOMMASTABS="以逗号和制表符分隔" +MENU_LABEL_TABLE_TABLETOTEXTTABS="依制表符分隔" MENU_LABEL_TABLE_TEXTTOTABLE="将文本转换为表格" MENU_LABEL_TABLE_TEXTTOTABLE_ALL="在标点和空格处拆分文本" MENU_LABEL_TABLE_TEXTTOTABLE_NOSPACES="在标点处拆分文本" MENU_LABEL_TOOLS="工具(&T)" MENU_LABEL_TOOLS_AUTOSPELL="自动检查拼写(&A)" -MENU_LABEL_TOOLS_HISTORY="文件历史(&D)" +MENU_LABEL_TOOLS_HISTORY="文档历史(&D)" MENU_LABEL_TOOLS_HISTORY_PURGE="删除历史(&P)" MENU_LABEL_TOOLS_HISTORY_SHOW="显示历史(&S)" MENU_LABEL_TOOLS_LANGUAGE="语言(&L)" @@ -1315,14 +1327,13 @@ MENU_LABEL_TOOLS_REVISIONS_ACCEPT_REVISION="接受修订(&A)" MENU_LABEL_TOOLS_REVISIONS_AUTO="保存全部历史(&M)" MENU_LABEL_TOOLS_REVISIONS_COMPARE_DOCUMENTS="比较文件(&C)" -MENU_LABEL_TOOLS_REVISIONS_FIND_NEXT="查找下一个修正" -MENU_LABEL_TOOLS_REVISIONS_FIND_PREV="查找上一个修正" -MENU_LABEL_TOOLS_REVISIONS_MARK="输入时检查(&M)" -MENU_LABEL_TOOLS_REVISIONS_MERGE_DOCUMENTS="合并文件(&E)" +MENU_LABEL_TOOLS_REVISIONS_FIND_NEXT="查找下一个修订" +MENU_LABEL_TOOLS_REVISIONS_FIND_PREV="查找上一个修订" +MENU_LABEL_TOOLS_REVISIONS_MARK="输入时标记修订(&M)" MENU_LABEL_TOOLS_REVISIONS_NEW_REVISION="开始新修订版(&W)" -MENU_LABEL_TOOLS_REVISIONS_PURGE="清理修正(&U)" -MENU_LABEL_TOOLS_REVISIONS_REJECT_REVISION="放弃修正(&R)" -MENU_LABEL_TOOLS_REVISIONS_SET_VIEW_LEVEL="选择修正(&S)" +MENU_LABEL_TOOLS_REVISIONS_PURGE="清理修订(&U)" +MENU_LABEL_TOOLS_REVISIONS_REJECT_REVISION="放弃修订(&R)" +MENU_LABEL_TOOLS_REVISIONS_SET_VIEW_LEVEL="选择修订(&S)" MENU_LABEL_TOOLS_REVISIONS_SHOW="显示修订(&H)" MENU_LABEL_TOOLS_REVISIONS_SHOW_AFTER="显示修订后的文档(&F)" MENU_LABEL_TOOLS_REVISIONS_SHOW_AFTERPREV="显示前一次修正后的文档(&P)" @@ -1335,22 +1346,22 @@ MENU_LABEL_TOOLTIP_INSERT_EQUATION="插入公式" MENU_LABEL_TOOLTIP_INSERT_EQUATION_FILE="从文件中插入MathML公式" MENU_LABEL_TOOLTIP_INSERT_EQUATION_LATEX="从LaTeX中插入公式" -MENU_LABEL_VIEW_DEFAULT_TB_LAYOUT="恢复到默认的模式(&R)" +MENU_LABEL_VIEW_DEFAULT_TB_LAYOUT="恢复到默认的布局(&R)" MENU_LABEL_VIEW_FULLSCREEN="全屏幕(&U)" MENU_LABEL_VIEW_HEADFOOT="页眉/页脚(&H)" -MENU_LABEL_VIEW_LOCKSTYLES="启动格式化工具(&F)" +MENU_LABEL_VIEW_LOCKSTYLES="启用格式化工具(&F)" MENU_LABEL_VIEW_LOCK_TB_LAYOUT="版面设定(&L)" -MENU_LABEL_VIEW_NORMAL="标准模式(&N)" -MENU_LABEL_VIEW_PRINT="打印模式(&P)" +MENU_LABEL_VIEW_NORMAL="标准布局(&N)" +MENU_LABEL_VIEW_PRINT="打印布局(&P)" MENU_LABEL_VIEW_RULER="显示标尺(&R)" MENU_LABEL_VIEW_SHOWPARA="显示格式标记(&F)" -MENU_LABEL_VIEW_STATUSBAR="显示状态列(&S)" +MENU_LABEL_VIEW_STATUSBAR="显示状态行(&S)" MENU_LABEL_VIEW_TB_1="(&1) %s" MENU_LABEL_VIEW_TB_2="(&2) %s" MENU_LABEL_VIEW_TB_3="(&3) %s" MENU_LABEL_VIEW_TB_4="(&4) %s" MENU_LABEL_VIEW_TOOLBARS="工具栏(&T)" -MENU_LABEL_VIEW_WEB="网页模式(&W)" +MENU_LABEL_VIEW_WEB="网页布局(&W)" MENU_LABEL_VIEW_ZOOM="缩放(&Z)" MENU_LABEL_VIEW_ZOOM_100="缩放至 &100%" MENU_LABEL_VIEW_ZOOM_200="缩放至 &200%" @@ -1371,7 +1382,7 @@ MENU_LABEL_WINDOW_7="(&7) %s" MENU_LABEL_WINDOW_8="(&8) %s" MENU_LABEL_WINDOW_9="(&9) %s" -MENU_LABEL_WINDOW_MORE="其他文件(&M)" +MENU_LABEL_WINDOW_MORE="更多文件(&M)" MENU_LABEL_WINDOW_NEW="新窗口(&N)" MENU_LABEL__BOGUS1__=" " MENU_LABEL__BOGUS2__=" " @@ -1386,37 +1397,37 @@ MENU_STATUSLINE_EDIT_COPYEMBED="复制嵌入对象" MENU_STATUSLINE_EDIT_COPYIMAGE="保存图像备份到剪贴板" MENU_STATUSLINE_EDIT_COPY_FRAME="复制文本框到剪贴板" -MENU_STATUSLINE_EDIT_COPY_HYPERLINK_LOCATION="复制超级链接地址" +MENU_STATUSLINE_EDIT_COPY_HYPERLINK_LOCATION="复制超链接地址" MENU_STATUSLINE_EDIT_CUT="剪切到剪贴板" MENU_STATUSLINE_EDIT_CUTEMBED="剪切嵌入对象" -MENU_STATUSLINE_EDIT_CUTIMAGE="移除图像并备份到剪贴板中" +MENU_STATUSLINE_EDIT_CUTIMAGE="删除图像并备份到剪贴板中" MENU_STATUSLINE_EDIT_CUT_FRAME="剪切文本框" MENU_STATUSLINE_EDIT_DELETEEMBED="删除嵌入对象" -MENU_STATUSLINE_EDIT_DELETEFRAME="将此文本框从文件中移除" -MENU_STATUSLINE_EDIT_DELETEIMAGE="将此图像从文件中移除" +MENU_STATUSLINE_EDIT_DELETEFRAME="将此文本框从文件中删除" +MENU_STATUSLINE_EDIT_DELETEIMAGE="将此图像从文件中删除" MENU_STATUSLINE_EDIT_EDITFOOTER="编辑本页的页脚" MENU_STATUSLINE_EDIT_EDITHEADER="编辑本页的页眉" -MENU_STATUSLINE_EDIT_FIND="搜寻特定的文字" +MENU_STATUSLINE_EDIT_FIND="查找特定的文字" MENU_STATUSLINE_EDIT_GOTO="跳到新的插入点" MENU_STATUSLINE_EDIT_LATEXEQUATION="编辑Latex公式" MENU_STATUSLINE_EDIT_PASTE="将剪贴板上的内容贴到工作区" MENU_STATUSLINE_EDIT_PASTE_SPECIAL="插入未格式化的剪贴板内容" MENU_STATUSLINE_EDIT_REDO="重做以前复原了的编辑" -MENU_STATUSLINE_EDIT_REMOVEFOOTER="把本页的页脚从文件中移除" -MENU_STATUSLINE_EDIT_REMOVEHEADER="把本页的页眉从文件中移除" -MENU_STATUSLINE_EDIT_REPLACE="替换此文本为其它文本" +MENU_STATUSLINE_EDIT_REMOVEFOOTER="把本页的页脚从文件中删除" +MENU_STATUSLINE_EDIT_REMOVEHEADER="把本页的页眉从文件中删除" +MENU_STATUSLINE_EDIT_REPLACE="将此文本替换为其它文本" MENU_STATUSLINE_EDIT_SELECTALL="选取整个文件" MENU_STATUSLINE_EDIT_SELECT_FRAME="选取文本框" MENU_STATUSLINE_EDIT_UNDO="取消修改" MENU_STATUSLINE_FILE=" " -MENU_STATUSLINE_FILE_CLOSE="关闭此文件" +MENU_STATUSLINE_FILE_CLOSE="关闭此文档" MENU_STATUSLINE_FILE_EXIT="关闭这个应用程序所有窗口并离开" MENU_STATUSLINE_FILE_EXPORT="以原来的文件名称保存文件" MENU_STATUSLINE_FILE_IMPORT="以副本打开新文件" MENU_STATUSLINE_FILE_IMPORTSTYLES="从文件中导入样式定义" MENU_STATUSLINE_FILE_NEW="新建文件" MENU_STATUSLINE_FILE_NEW_USING_TEMPLATE="从模板新建文件" -MENU_STATUSLINE_FILE_OPEN="打开已存在的文件" +MENU_STATUSLINE_FILE_OPEN="打开已有文件" MENU_STATUSLINE_FILE_PAGESETUP="改变打印选项" MENU_STATUSLINE_FILE_PRINT="打印文件或其部份" MENU_STATUSLINE_FILE_PRINT_DIRECTLY="使用内部的 PS 驱动程序打印" @@ -1432,7 +1443,7 @@ MENU_STATUSLINE_FILE_RECENT_7="打开这份文件" MENU_STATUSLINE_FILE_RECENT_8="打开这份文件" MENU_STATUSLINE_FILE_RECENT_9="打开这份文件" -MENU_STATUSLINE_FILE_REVERT="把文件恢复至上一次保存时的状态" +MENU_STATUSLINE_FILE_REVERT="把文件恢复至上一次保存的状态" MENU_STATUSLINE_FILE_SAVE="保存这份文件" MENU_STATUSLINE_FILE_SAVEAS="将文件换名保存" MENU_STATUSLINE_FILE_SAVEEMBED="保存嵌入对象" @@ -1446,7 +1457,7 @@ MENU_STATUSLINE_FMT_BORDERS="向选定的区域添加边框及底纹设定" MENU_STATUSLINE_FMT_BOTTOMLINE="选区内加行底线 (切换)" MENU_STATUSLINE_FMT_BULLETS="在选中的段落中增加或修改项目符号和编号" -MENU_STATUSLINE_FMT_COLUMNS="改变字段数" +MENU_STATUSLINE_FMT_COLUMNS="改变栏数" MENU_STATUSLINE_FMT_DIRECTION="改变文本的方向" MENU_STATUSLINE_FMT_DIRECTION_DD_RTL="把本段落文字方向改为右到左" MENU_STATUSLINE_FMT_DIRECTION_DOCD_RTL="把本文档文本方向改为右到左" @@ -1455,26 +1466,26 @@ MENU_STATUSLINE_FMT_DIRECTION_SD_RTL="把本节文字方向改为右到左" MENU_STATUSLINE_FMT_DOCUMENT="设定您的文件的版面属性,例如纸张大小和边界" MENU_STATUSLINE_FMT_EMBED="格式化嵌入对象" -MENU_STATUSLINE_FMT_FONT="改变已选文字的字型" +MENU_STATUSLINE_FMT_FONT="改变选中文字的字体" MENU_STATUSLINE_FMT_FOOTNOTES="设定脚注及尾注类型" MENU_STATUSLINE_FMT_FRAME="改变文本框的属性" MENU_STATUSLINE_FMT_HDRFTR="设定页眉及页脚类型" MENU_STATUSLINE_FMT_IMAGE="改变这个图像的大小" MENU_STATUSLINE_FMT_ITALIC="使选取区字体变斜 (切换)" -MENU_STATUSLINE_FMT_LANGUAGE="改变已选文字的语言" +MENU_STATUSLINE_FMT_LANGUAGE="改变选中文字的语言" MENU_STATUSLINE_FMT_OVERLINE="在选取区加入上标线 (切换)" -MENU_STATUSLINE_FMT_PARAGRAPH="改变已选段落的格式" +MENU_STATUSLINE_FMT_PARAGRAPH="改变选中段落的格式" MENU_STATUSLINE_FMT_POSIMAGE="设定这个图像格式" MENU_STATUSLINE_FMT_SETPOSIMAGE="固定本图片" MENU_STATUSLINE_FMT_STRIKE="为选取区文字加删除线 (切换)" -MENU_STATUSLINE_FMT_STYLE="为选取区文字定义或套用样式" -MENU_STATUSLINE_FMT_STYLE_DEFINE="为选取区文字定义或套用样式" +MENU_STATUSLINE_FMT_STYLE="为选中文字定义或应用样式" +MENU_STATUSLINE_FMT_STYLE_DEFINE="为选中文字定义或应用样式" MENU_STATUSLINE_FMT_STYLIST="用样式设定你的文件" MENU_STATUSLINE_FMT_SUBSCRIPT="使选取区文字成为下标字 (切换)" MENU_STATUSLINE_FMT_SUPERSCRIPT="使选取区文字成为上标字 (切换)" MENU_STATUSLINE_FMT_TABLEOFCONTENTS="设定目录类型及样式" MENU_STATUSLINE_FMT_TABS="设定制表符" -MENU_STATUSLINE_FMT_TOGGLECASE="改变已选文字的大小写" +MENU_STATUSLINE_FMT_TOGGLECASE="改变选中文字的大小写" MENU_STATUSLINE_FMT_TOPLINE="选区内加行顶线 (切换)" MENU_STATUSLINE_FMT_UNDERLINE="在选取区加下划线(切换)" MENU_STATUSLINE_FORMAT=" " @@ -1488,6 +1499,7 @@ MENU_STATUSLINE_HELP_REPORT_BUG="报告程序错误,让AbiWord做得更好" MENU_STATUSLINE_HELP_SEARCH="在帮助中搜寻相关内容..." MENU_STATUSLINE_INSERT=" " +MENU_STATUSLINE_INSERT_ANNOTATION="插入注解" MENU_STATUSLINE_INSERT_BOOKMARK="插入书签" MENU_STATUSLINE_INSERT_BREAK="插入一个分页符、分栏符或分节符" MENU_STATUSLINE_INSERT_CLIPART="插入美工图案" @@ -1502,7 +1514,7 @@ MENU_STATUSLINE_INSERT_FILE="插入另一个文件的内容目录" MENU_STATUSLINE_INSERT_FOOTER="插入页脚" MENU_STATUSLINE_INSERT_FOOTNOTE="插入脚注" -MENU_STATUSLINE_INSERT_GOTO_HYPERLINK="转到超级链接" +MENU_STATUSLINE_INSERT_GOTO_HYPERLINK="转到超链接" MENU_STATUSLINE_INSERT_GRAPHIC="插入现有的文件中图片" MENU_STATUSLINE_INSERT_HEADER="插入页眉" MENU_STATUSLINE_INSERT_HYPERLINK="插入超级链接" @@ -1533,7 +1545,7 @@ MENU_STATUSLINE_TABLE_DELETE_TABLE="删除表格" MENU_STATUSLINE_TABLE_FORMAT="设定表格格式" MENU_STATUSLINE_TABLE_HEADING_ROWS_REPEAT="换页时重复此行作为标题" -MENU_STATUSLINE_TABLE_HEADING_ROWS_REPEAT_REMOVE="移除本页首行" +MENU_STATUSLINE_TABLE_HEADING_ROWS_REPEAT_REMOVE="删除本页首行" MENU_STATUSLINE_TABLE_HEADING_ROWS_REPEAT_THIS="把这一行设定为每一页出现的表格标题" MENU_STATUSLINE_TABLE_INSERTCOLUMN="插入一列到右边" MENU_STATUSLINE_TABLE_INSERTROW="向下插入行" @@ -1559,18 +1571,18 @@ MENU_STATUSLINE_TABLE_SPLIT_CELLS="拆分单元格" MENU_STATUSLINE_TABLE_SPLIT_TABLE="拆分表格" MENU_STATUSLINE_TABLE_TABLETOTEXT="从表格转换到文本" -MENU_STATUSLINE_TABLE_TABLETOTEXTCOMMAS="依逗号分割表格项目" -MENU_STATUSLINE_TABLE_TABLETOTEXTCOMMASTABS="依逗号和标签分割表格项目" -MENU_STATUSLINE_TABLE_TABLETOTEXTTABS="依标签分割表格项目" +MENU_STATUSLINE_TABLE_TABLETOTEXTCOMMAS="以逗号分隔表格项目" +MENU_STATUSLINE_TABLE_TABLETOTEXTCOMMASTABS="以逗号和标签分隔表格项目" +MENU_STATUSLINE_TABLE_TABLETOTEXTTABS="以制表符分隔表格项目" MENU_STATUSLINE_TABLE_TEXTTOTABLE="将选中的文本转换为表格" MENU_STATUSLINE_TABLE_TEXTTOTABLE_ALL="拆分所有的边界(包括空格)" MENU_STATUSLINE_TABLE_TEXTTOTABLE_NOSPACES="拆分所有的边界(除了空格)" MENU_STATUSLINE_TOOLS=" " MENU_STATUSLINE_TOOLS_AUTOSPELL="自动为文件检查拼写" MENU_STATUSLINE_TOOLS_HISTORY="查看当前文件的历史" -MENU_STATUSLINE_TOOLS_HISTORY_PURGE="从文件中移除文档全部历史" +MENU_STATUSLINE_TOOLS_HISTORY_PURGE="从文件中删除文档全部历史" MENU_STATUSLINE_TOOLS_HISTORY_SHOW="查看文档历史" -MENU_STATUSLINE_TOOLS_LANGUAGE="改变已选文字的语言" +MENU_STATUSLINE_TOOLS_LANGUAGE="改变选中文字的语言" MENU_STATUSLINE_TOOLS_MAILMERGE="邮件合并" MENU_STATUSLINE_TOOLS_OPTIONS="设定偏好" MENU_STATUSLINE_TOOLS_PLUGINS="管理插件" @@ -1578,13 +1590,13 @@ MENU_STATUSLINE_TOOLS_REVISIONS_ACCEPT_REVISION="接受建议的更改" MENU_STATUSLINE_TOOLS_REVISIONS_AUTO="保留每一页的更改" MENU_STATUSLINE_TOOLS_REVISIONS_COMPARE_DOCUMENTS="把当前文件与另一文件进行比较" -MENU_STATUSLINE_TOOLS_REVISIONS_FIND_NEXT="查找文件中下一个明显修正" -MENU_STATUSLINE_TOOLS_REVISIONS_FIND_PREV="查找文件中上一个明显修正" +MENU_STATUSLINE_TOOLS_REVISIONS_FIND_NEXT="查找文件中下一个可见修订" +MENU_STATUSLINE_TOOLS_REVISIONS_FIND_PREV="查找文件中上一个可见修订" MENU_STATUSLINE_TOOLS_REVISIONS_MARK="输入时标记修订" MENU_STATUSLINE_TOOLS_REVISIONS_MERGE_DOCUMENTS="把另外的文件合并到当前文件" MENU_STATUSLINE_TOOLS_REVISIONS_NEW_REVISION="从当前的文本进行严谨的检查" -MENU_STATUSLINE_TOOLS_REVISIONS_PURGE="移除文档中所有的修订信息" -MENU_STATUSLINE_TOOLS_REVISIONS_REJECT_REVISION="移除这个建议的更改" +MENU_STATUSLINE_TOOLS_REVISIONS_PURGE="删除文档中的所有修订信息" +MENU_STATUSLINE_TOOLS_REVISIONS_REJECT_REVISION="删除这个建议的更改" MENU_STATUSLINE_TOOLS_REVISIONS_SET_VIEW_LEVEL="选择哪一个你要看的修正" MENU_STATUSLINE_TOOLS_REVISIONS_SHOW="显示现在在文档中的修正" MENU_STATUSLINE_TOOLS_REVISIONS_SHOW_AFTER="显示修正后的文档的样子" @@ -1596,10 +1608,10 @@ MENU_STATUSLINE_TOOLS_SPELLPREFS="设定您的拼写检查偏好" MENU_STATUSLINE_TOOLS_WORDCOUNT="计算本篇文章的字数" MENU_STATUSLINE_VIEW=" " -MENU_STATUSLINE_VIEW_DEFAULT_TB_LAYOUT="恢复工具栏的默认设置" +MENU_STATUSLINE_VIEW_DEFAULT_TB_LAYOUT="恢复工具栏的默认布局" MENU_STATUSLINE_VIEW_FULLSCREEN="以全屏幕模式查看文件" MENU_STATUSLINE_VIEW_HEADFOOT="编辑每一页的页眉/页脚" -MENU_STATUSLINE_VIEW_LOCKSTYLES="允许只用样式格式化" +MENU_STATUSLINE_VIEW_LOCKSTYLES="允许只用样式进行格式化" MENU_STATUSLINE_VIEW_LOCK_TB_LAYOUT="锁定当前工具栏的布局" MENU_STATUSLINE_VIEW_NORMAL="标准查看模式" MENU_STATUSLINE_VIEW_PRINT="打印模式" @@ -1638,20 +1650,20 @@ MENU_STATUSLINE__BOGUS2__=" " MSG_AfterRestartNew="这项变更要等到您重新启动 AbiWord 或打开新文件后才会生效。" MSG_AutoMerge="自动合并" -MSG_AutoRevisionOffWarning="你确认你不想保存全部的历史记录吗?如果你这样执行,你就不能够还原这个文档。" -MSG_BookmarkNotFound="在这份文件中找不到书签 "%s"" -MSG_CHECK_PRINT_MODE="页眉和页脚只能在打印模式中编辑 要进入这种模式,从菜单中选择查看->打印模式。 你现在要进入打印模式吗?" +MSG_AutoRevisionOffWarning="你确认不想保存全部的历史记录吗?如果你这样执行,你就不能将这个文档还原至早期版本。" +MSG_BookmarkNotFound="在文档中找不到书签 "%s"" +MSG_CHECK_PRINT_MODE="页眉和页脚只能在打印视图中创建和编辑 要进入这种模式,从菜单中选择查看->打印布局。 你现在要进入打印模式吗?" MSG_ConfirmSave="关闭文档 %s 之前保存?" MSG_ConfirmSaveSecondary="如果你不保存你的修改,他们将会丢失。" MSG_DefaultDirectionChg="您已改变了预设方向" MSG_DirectionModeChg="您已改变了方向模式" -MSG_DlgNotImp="%s 功能尚未写好。 如果您是一位程序设计师,欢迎您在 %s,第 %d 行加入程序代码, 并把补丁寄到: \tabiword-dev@abisource.com 否则,请您耐心等待了。" +MSG_DlgNotImp="%s 功能尚未实现。 如果您是一位程序员,欢迎您在 %s,第 %d 行加入程序代码, 并把补丁寄到: \tabiword-dev@abisource.com 否则,还请您耐心等待。" MSG_EmptySelection="当前选择为空" -MSG_Exception="发生致命错误,Abiword将要关闭了。 当前的文档已经被保存到了一".saved"扩展的文件。" -MSG_HiddenRevisions="这份文件包含有隐藏的修正。请参阅AbiWord关于处理修正的文档。" -MSG_HyperlinkCrossesBoundaries="超级链接所依附的文字必须在一段之内。" +MSG_Exception="发生致命错误,Abiword将要关闭了。 当前的文档已经被保存到一个扩展名为".saved"的文件。" +MSG_HiddenRevisions="这份文件包含有隐藏的修订。请参阅AbiWord关于处理修订的文档。" +MSG_HyperlinkCrossesBoundaries="超链接所依附的文字必须在一段之内。" MSG_HyperlinkNoBookmark="警告: 您提供的书签 [%s] 并不存在。" -MSG_HyperlinkNoSelection="您插入超级链接之前必须先选择文件的一部份。" +MSG_HyperlinkNoSelection="您插入超链接之前必须先选择文件的一部份。" MSG_IE_BogusDocument="AbiWord 不能打开 %s,它可能是一个无效的文件" MSG_IE_CouldNotOpen="不能打开%s 进行写入" MSG_IE_CouldNotWrite="不能写入文件 %s " @@ -1661,7 +1673,6 @@ MSG_IE_UnknownType="文件 %s 类型不明" MSG_IE_UnsupportedType="文件 %s 不属于目前支持的文件类型" MSG_ImportError="导入文件 %s 发生错误。" -MSG_MergeDocsNotRelated="您尝试合并的文件并不相关. AbiWord将尝试 合并它们,但是结果可能没有意义。" MSG_NoBreakInsideFrame="在文字框中无法插入间隔" MSG_NoBreakInsideTable="在表格中无法插入间隔" MSG_OpenFailed="不能打开文件 %s 。" @@ -1672,16 +1683,17 @@ MSG_RevertFile="把文件恢复到上次保存的状态?" MSG_SaveFailed="不能写入文件 %s 。" MSG_SaveFailedExport="保存 %s 时发生错误: 不能构建导出器" -MSG_SaveFailedName="保存 %s 时发生错误: 档名无效" +MSG_SaveFailedName="保存 %s 时发生错误: 文档名无效" MSG_SaveFailedWrite="保存 %s 时发生写入错误" -MSG_SpellDone="拼写检查已经完成了。" +MSG_SpellDone="拼写检查完成。" MSG_SpellSelectionDone="AbiWord完成检查选中的部分。" -PRINT_CANNOTSTARTPRINTJOB="不能开始打印工作" +PRINT_CANNOTSTARTPRINTJOB="不能开始打印任务" PageInfoField="第 %d 页 共 %d 页" RightIndentStatus="右缩进 [%s]" RightMarginStatus="右边界 [%s]" SCRIPT_CANTRUN="执行 %s 脚本时发生错误" SCRIPT_NOSCRIPTS="找不到任何脚本" +TB_Embedded="嵌入" TB_Extra="额外" TB_Format="格式" TB_Simple="简单" @@ -1707,8 +1719,8 @@ TOOLBAR_LABEL_EDIT_HEADER="编辑页眉" TOOLBAR_LABEL_EDIT_PASTE="粘贴" TOOLBAR_LABEL_EDIT_REDO="重做" -TOOLBAR_LABEL_EDIT_REMOVEFOOTER="移除页脚" -TOOLBAR_LABEL_EDIT_REMOVEHEADER="移除页眉" +TOOLBAR_LABEL_EDIT_REMOVEFOOTER="删除页脚" +TOOLBAR_LABEL_EDIT_REMOVEHEADER="删除页眉" TOOLBAR_LABEL_EDIT_UNDO="撤销" TOOLBAR_LABEL_FILE_NEW="新建" TOOLBAR_LABEL_FILE_OPEN="打开" @@ -1731,6 +1743,7 @@ TOOLBAR_LABEL_INSERT_TABLE="插入表格" TOOLBAR_LABEL_LISTS_BULLETS="项目符号" TOOLBAR_LABEL_LISTS_NUMBERS="项目编号" +TOOLBAR_LABEL_MENU="菜单" TOOLBAR_LABEL_MERGEABOVE="向上合并" TOOLBAR_LABEL_MERGEBELOW="向下合并" TOOLBAR_LABEL_MERGELEFT="向左合并" @@ -1749,8 +1762,8 @@ TOOLBAR_STATUSLINE_1COLUMN="一栏" TOOLBAR_STATUSLINE_2COLUMN="二栏" TOOLBAR_STATUSLINE_3COLUMN="三栏" -TOOLBAR_STATUSLINE_ADD_COLUMN="在当前列后向这个表格添加一列" -TOOLBAR_STATUSLINE_ADD_ROW="在当前行后向这个表格添加一行" +TOOLBAR_STATUSLINE_ADD_COLUMN="在表格的当前列后添加一列" +TOOLBAR_STATUSLINE_ADD_ROW="在表格的当前行后添加一行" TOOLBAR_STATUSLINE_ALIGN_CENTER="居中对齐" TOOLBAR_STATUSLINE_ALIGN_JUSTIFY="段落左右对齐" TOOLBAR_STATUSLINE_ALIGN_LEFT="左对齐" @@ -1765,17 +1778,17 @@ TOOLBAR_STATUSLINE_EDIT_FOOTER="编辑页脚" TOOLBAR_STATUSLINE_EDIT_HEADER="编辑页眉" TOOLBAR_STATUSLINE_EDIT_PASTE="粘贴" -TOOLBAR_STATUSLINE_EDIT_REDO="复原编辑" -TOOLBAR_STATUSLINE_EDIT_REMOVEFOOTER="移除页脚" -TOOLBAR_STATUSLINE_EDIT_REMOVEHEADER="移除页眉" +TOOLBAR_STATUSLINE_EDIT_REDO="重做编辑" +TOOLBAR_STATUSLINE_EDIT_REMOVEFOOTER="删除页脚" +TOOLBAR_STATUSLINE_EDIT_REMOVEHEADER="删除页眉" TOOLBAR_STATUSLINE_EDIT_UNDO="取消修改" TOOLBAR_STATUSLINE_FILE_NEW="新建文件" -TOOLBAR_STATUSLINE_FILE_OPEN="打开已存在的文件" +TOOLBAR_STATUSLINE_FILE_OPEN="打开已有文件" TOOLBAR_STATUSLINE_FILE_PRINT="打印文件" TOOLBAR_STATUSLINE_FILE_PRINT_PREVIEW="打印前先预览文件" TOOLBAR_STATUSLINE_FILE_SAVE="保存这份文件" TOOLBAR_STATUSLINE_FILE_SAVEAS="将文件换名保存" -TOOLBAR_STATUSLINE_FMTPAINTER="把原来复制的文段覆盖选中的文字" +TOOLBAR_STATUSLINE_FMTPAINTER="将之前复制文段的格式应用于选中的文字" TOOLBAR_STATUSLINE_FMT_BOOKMARK="插入书签到文件" TOOLBAR_STATUSLINE_FMT_CHOOSE="选择字体" TOOLBAR_STATUSLINE_FMT_DIR_OVERRIDE_LTR="强制文字从左到右方向" @@ -1791,6 +1804,7 @@ TOOLBAR_STATUSLINE_INSERT_TABLE="在文件中新建表格" TOOLBAR_STATUSLINE_LISTS_BULLETS="项目符号" TOOLBAR_STATUSLINE_LISTS_NUMBERS="项目编号" +TOOLBAR_STATUSLINE_MENU="菜单" TOOLBAR_STATUSLINE_MERGEABOVE="和上面的单元格合并" TOOLBAR_STATUSLINE_MERGEBELOW="和下面的单元格合并" TOOLBAR_STATUSLINE_MERGELEFT="和左边的单元格合并" @@ -1809,8 +1823,8 @@ TOOLBAR_TOOLTIP_1COLUMN="一栏" TOOLBAR_TOOLTIP_2COLUMN="二栏" TOOLBAR_TOOLTIP_3COLUMN="三栏" -TOOLBAR_TOOLTIP_ADD_COLUMN="在当前列后向这个表格添加一列" -TOOLBAR_TOOLTIP_ADD_ROW="在当前行后向这个表格添加一行" +TOOLBAR_TOOLTIP_ADD_COLUMN="在表格的当前列后添加一列" +TOOLBAR_TOOLTIP_ADD_ROW="在表格的当前行后添加一行" TOOLBAR_TOOLTIP_ALIGN_CENTER="居中对齐" TOOLBAR_TOOLTIP_ALIGN_JUSTIFY="段落左右对齐" TOOLBAR_TOOLTIP_ALIGN_LEFT="左对齐" @@ -1825,17 +1839,17 @@ TOOLBAR_TOOLTIP_EDIT_FOOTER="编辑页脚" TOOLBAR_TOOLTIP_EDIT_HEADER="编辑页眉" TOOLBAR_TOOLTIP_EDIT_PASTE="粘贴" -TOOLBAR_TOOLTIP_EDIT_REDO="复原编辑" -TOOLBAR_TOOLTIP_EDIT_REMOVEFOOTER="移除页脚" -TOOLBAR_TOOLTIP_EDIT_REMOVEHEADER="移除页眉" +TOOLBAR_TOOLTIP_EDIT_REDO="重做编辑" +TOOLBAR_TOOLTIP_EDIT_REMOVEFOOTER="删除页脚" +TOOLBAR_TOOLTIP_EDIT_REMOVEHEADER="删除页眉" TOOLBAR_TOOLTIP_EDIT_UNDO="取消修改" TOOLBAR_TOOLTIP_FILE_NEW="新建文件" -TOOLBAR_TOOLTIP_FILE_OPEN="打开已存在的文件" +TOOLBAR_TOOLTIP_FILE_OPEN="打开已有文件" TOOLBAR_TOOLTIP_FILE_PRINT="打印文件" TOOLBAR_TOOLTIP_FILE_PRINT_PREVIEW="打印前先预览文件" TOOLBAR_TOOLTIP_FILE_SAVE="保存这份文件" TOOLBAR_TOOLTIP_FILE_SAVEAS="将文件换名保存" -TOOLBAR_TOOLTIP_FMTPAINTER="把原来复制的文段覆盖选中的文字" +TOOLBAR_TOOLTIP_FMTPAINTER="将之前复制文段的格式应用于选中的文字" TOOLBAR_TOOLTIP_FMT_BOOKMARK="插入书签到文件" TOOLBAR_TOOLTIP_FMT_CHOOSE="选择字体" TOOLBAR_TOOLTIP_FMT_DIR_OVERRIDE_LTR="强制文字从左到右方向" @@ -1851,6 +1865,7 @@ TOOLBAR_TOOLTIP_INSERT_TABLE="在文件中新建表格" TOOLBAR_TOOLTIP_LISTS_BULLETS="项目符号" TOOLBAR_TOOLTIP_LISTS_NUMBERS="项目编号" +TOOLBAR_TOOLTIP_MENU="菜单" TOOLBAR_TOOLTIP_MERGEABOVE="和上面的单元格合并" TOOLBAR_TOOLTIP_MERGEBELOW="和下面的单元格合并" TOOLBAR_TOOLTIP_MERGELEFT="和左边的单元格合并" diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword/user/wp/templates/normal.awt-de_CH /tmp/qY2gb79Nml/abiword-2.6.4/abiword/user/wp/templates/normal.awt-de_CH --- abiword-2.6.2/abiword/user/wp/templates/normal.awt-de_CH 2008-04-06 17:00:58.000000000 +0100 +++ abiword-2.6.4/abiword/user/wp/templates/normal.awt-de_CH 2008-07-13 14:11:00.000000000 +0100 @@ -1,6 +1,6 @@ - + diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-docs/configure /tmp/qY2gb79Nml/abiword-2.6.4/abiword-docs/configure --- abiword-2.6.2/abiword-docs/configure 2008-04-06 22:25:40.000000000 +0100 +++ abiword-2.6.4/abiword-docs/configure 2008-07-13 14:09:50.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for abiword-docs 2.6.2. +# Generated by GNU Autoconf 2.61 for abiword-docs 2.6.4. # # Report bugs to . # @@ -574,8 +574,8 @@ # Identity of this package. PACKAGE_NAME='abiword-docs' PACKAGE_TARNAME='abiword-docs' -PACKAGE_VERSION='2.6.2' -PACKAGE_STRING='abiword-docs 2.6.2' +PACKAGE_VERSION='2.6.4' +PACKAGE_STRING='abiword-docs 2.6.4' PACKAGE_BUGREPORT='http://www.abisource.com/' ac_subst_vars='SHELL @@ -1154,7 +1154,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures abiword-docs 2.6.2 to adapt to many kinds of systems. +\`configure' configures abiword-docs 2.6.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1220,7 +1220,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of abiword-docs 2.6.2:";; + short | recursive ) echo "Configuration of abiword-docs 2.6.4:";; esac cat <<\_ACEOF @@ -1296,7 +1296,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -abiword-docs configure 2.6.2 +abiword-docs configure 2.6.4 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1310,7 +1310,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by abiword-docs $as_me 2.6.2, which was +It was created by abiword-docs $as_me 2.6.4, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2000,7 +2000,7 @@ # Define the identity of the package. PACKAGE='abiword-docs' - VERSION='2.6.2' + VERSION='2.6.4' cat >>confdefs.h <<_ACEOF @@ -2857,7 +2857,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by abiword-docs $as_me 2.6.2, which was +This file was extended by abiword-docs $as_me 2.6.4, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2900,7 +2900,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -abiword-docs config.status 2.6.2 +abiword-docs config.status 2.6.4 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-docs/configure.ac /tmp/qY2gb79Nml/abiword-2.6.4/abiword-docs/configure.ac --- abiword-2.6.2/abiword-docs/configure.ac 2008-04-06 22:24:07.000000000 +0100 +++ abiword-2.6.4/abiword-docs/configure.ac 2008-07-13 13:05:31.000000000 +0100 @@ -1,5 +1,5 @@ -AC_INIT([abiword-docs],[2.6.2],[http://www.abisource.com/]) +AC_INIT([abiword-docs],[2.6.4],[http://www.abisource.com/]) AM_INIT_AUTOMAKE PKG_PROG_PKG_CONFIG diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-extras/aclocal.m4 /tmp/qY2gb79Nml/abiword-2.6.4/abiword-extras/aclocal.m4 --- abiword-2.6.2/abiword-extras/aclocal.m4 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/abiword-extras/aclocal.m4 2008-07-13 13:07:33.000000000 +0100 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,13 +11,10 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.61],, -[m4_warning([this file was generated for autoconf 2.61. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # @@ -177,7 +174,7 @@ fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -192,7 +189,7 @@ [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.1], [], +m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -208,10 +205,8 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -483,7 +478,7 @@ # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -531,13 +526,13 @@ # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008 Free Software Foundation, Inc. +# 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 13 +# serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -642,17 +637,16 @@ # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. -_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $_am_arg | $_am_arg:* ) + $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # @@ -924,7 +918,7 @@ # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-extras/clipart/Makefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-extras/clipart/Makefile.in --- abiword-2.6.2/abiword-extras/clipart/Makefile.in 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/abiword-extras/clipart/Makefile.in 2008-07-13 14:09:48.000000000 +0100 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-extras/configure /tmp/qY2gb79Nml/abiword-2.6.4/abiword-extras/configure --- abiword-2.6.2/abiword-extras/configure 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/abiword-extras/configure 2008-07-13 14:09:50.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for abiword-extras 2.6.2. +# Generated by GNU Autoconf 2.61 for abiword-extras 2.6.4. # # Report bugs to . # @@ -574,8 +574,8 @@ # Identity of this package. PACKAGE_NAME='abiword-extras' PACKAGE_TARNAME='abiword-extras' -PACKAGE_VERSION='2.6.2' -PACKAGE_STRING='abiword-extras 2.6.2' +PACKAGE_VERSION='2.6.4' +PACKAGE_STRING='abiword-extras 2.6.4' PACKAGE_BUGREPORT='http://www.abisource.com/' # Factoring default headers for most tests. @@ -1215,7 +1215,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures abiword-extras 2.6.2 to adapt to many kinds of systems. +\`configure' configures abiword-extras 2.6.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1281,7 +1281,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of abiword-extras 2.6.2:";; + short | recursive ) echo "Configuration of abiword-extras 2.6.4:";; esac cat <<\_ACEOF @@ -1370,7 +1370,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -abiword-extras configure 2.6.2 +abiword-extras configure 2.6.4 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1384,7 +1384,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by abiword-extras $as_me 2.6.2, which was +It was created by abiword-extras $as_me 2.6.4, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2074,7 +2074,7 @@ # Define the identity of the package. PACKAGE='abiword-extras' - VERSION='2.6.2' + VERSION='2.6.4' cat >>confdefs.h <<_ACEOF @@ -4312,7 +4312,7 @@ fi -abi_pkg='abiword' +abi_pkg='abiword-2.6' pkg_failed=no { echo "$as_me:$LINENO: checking for ABIWORD_EXTRAS_DEPS" >&5 @@ -4877,7 +4877,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by abiword-extras $as_me 2.6.2, which was +This file was extended by abiword-extras $as_me 2.6.4, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4924,7 +4924,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -abiword-extras config.status 2.6.2 +abiword-extras config.status 2.6.4 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -5505,7 +5505,7 @@ # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-extras/configure.ac /tmp/qY2gb79Nml/abiword-2.6.4/abiword-extras/configure.ac --- abiword-2.6.2/abiword-extras/configure.ac 2008-04-06 22:23:51.000000000 +0100 +++ abiword-2.6.4/abiword-extras/configure.ac 2008-07-13 13:04:50.000000000 +0100 @@ -1,5 +1,5 @@ -AC_INIT([abiword-extras],[2.6.2],[http://www.abisource.com/]) +AC_INIT([abiword-extras],[2.6.4],[http://www.abisource.com/]) AM_INIT_AUTOMAKE PKG_PROG_PKG_CONFIG diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-extras/dictionary/Makefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-extras/dictionary/Makefile.in --- abiword-2.6.2/abiword-extras/dictionary/Makefile.in 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/abiword-extras/dictionary/Makefile.in 2008-07-13 14:09:48.000000000 +0100 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-extras/Makefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-extras/Makefile.in --- abiword-2.6.2/abiword-extras/Makefile.in 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/abiword-extras/Makefile.in 2008-07-13 14:09:49.000000000 +0100 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -277,8 +277,8 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -303,8 +303,8 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -314,12 +314,13 @@ CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -393,10 +394,6 @@ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) - dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -423,8 +420,6 @@ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -575,17 +570,17 @@ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-hook dist-lzma dist-shar dist-tarZ dist-zip distcheck \ - distclean distclean-generic distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am tags tags-recursive uninstall uninstall-am + dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + tags-recursive uninstall uninstall-am dist-hook: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-extras/templates/Makefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-extras/templates/Makefile.in --- abiword-2.6.2/abiword-extras/templates/Makefile.in 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/abiword-extras/templates/Makefile.in 2008-07-13 14:09:49.000000000 +0100 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/acinclude.m4 /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/acinclude.m4 --- abiword-2.6.2/abiword-plugins/acinclude.m4 2008-04-06 22:37:21.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/acinclude.m4 2008-07-13 14:09:32.000000000 +0100 @@ -178,21 +178,36 @@ # -# Checks for the collaborate.abisource.com service backend +# Checks for the abicollab.net service backend # -AC_ARG_WITH(abicollab-service-backend,[ --with-abicollab-service-backend enable the collaborate.abisource.com service backend for abicollab],[ +AC_ARG_WITH(abicollab-service-backend,[ --with-abicollab-service-backend enable the abicollab.net service backend for abicollab; NOTE to packagers: do NOT enable this, the service is not publically available yet],[ AC_CHECK_HEADERS(asio.hpp,[ - ABI_PLUGIN_REPORT([abicollab collaborate.abisource.com support: yes]) abicollab_handler_service=yes - ],[ ABI_PLUGIN_REPORT([abicollab collaborate.abisource.com support: no, asio >= 0.3.8rc1 required]) + ],[ ABI_PLUGIN_REPORT([abicollab abicollab.net support: no, asio >= 0.3.8rc1 required]) ]) + + if test "x$abicollab_handler_service" = "xyes" ; then + PKG_CHECK_MODULES(ABICOLLAB_SOUP, [libsoup-2.2 >= 2.2.100],[ + ABI_PLUGIN_REPORT([abicollab abicollab.net support: yes]) + abicollab_handler_service=yes + ],[ PKG_CHECK_MODULES(ABICOLLAB_SOUP, [libsoup-2.4 >= 2.4.1],[ + ABICOLLAB_SOUP_CFLAGS+=-DSOUP24 + ABI_PLUGIN_REPORT([abicollab abicollab.net support: yes]) + abicollab_handler_service=yes + ],[ + ABI_PLUGIN_REPORT([abicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required]) + abicollab_handler_service=no + ]) + ]) + fi + ],[ - ABI_PLUGIN_REPORT([abicollab collaborate.abisource.com support: no]) + ABI_PLUGIN_REPORT([abicollab abicollab.net support: no]) abicollab_handler_service=no ]) if test "x$abicollab_handler_service" = "xyes" ; then - ABICOLLAB_SERVICE_CPPFLAGS="-DABICOLLAB_HANDLER_SERVICE $ABICOLLAB_ASIO_CPPFLAGS" - ABICOLLAB_SERVICE_LIBS="-lpthread" + ABICOLLAB_SERVICE_CPPFLAGS="-DABICOLLAB_HANDLER_SERVICE $ABICOLLAB_ASIO_CPPFLAGS $ABICOLLAB_SOUP_CFLAGS" + ABICOLLAB_SERVICE_LIBS="-lpthread $ABICOLLAB_SOUP_LIBS" fi AC_SUBST(ABICOLLAB_SERVICE_CPPFLAGS) AC_SUBST(ABICOLLAB_SERVICE_LIBS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/configure /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/configure --- abiword-2.6.2/abiword-plugins/configure 2008-04-06 22:38:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/configure 2008-07-13 14:10:30.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for abiword-plugins 2.6.2. +# Generated by GNU Autoconf 2.61 for abiword-plugins 2.6.4. # # Report bugs to . # @@ -728,8 +728,8 @@ # Identity of this package. PACKAGE_NAME='abiword-plugins' PACKAGE_TARNAME='abiword-plugins' -PACKAGE_VERSION='2.6.2' -PACKAGE_STRING='abiword-plugins 2.6.2' +PACKAGE_VERSION='2.6.4' +PACKAGE_STRING='abiword-plugins 2.6.4' PACKAGE_BUGREPORT='http://bugzilla.abisource.com/' ac_unique_file="ac-helpers/abi-plugin-init.m4" @@ -917,6 +917,8 @@ _abi_dbus_glib_LIBS ABICOLLAB_SUGAR_CPPFLAGS ABICOLLAB_SUGAR_LIBS +ABICOLLAB_SOUP_CFLAGS +ABICOLLAB_SOUP_LIBS ABICOLLAB_SERVICE_CPPFLAGS ABICOLLAB_SERVICE_LIBS ABICOLLAB_HANDLER_FAKE_TRUE @@ -1063,6 +1065,8 @@ _abi_dbus_LIBS _abi_dbus_glib_CFLAGS _abi_dbus_glib_LIBS +ABICOLLAB_SOUP_CFLAGS +ABICOLLAB_SOUP_LIBS _abi_glib_CFLAGS _abi_glib_LIBS GOFFICE_CFLAGS @@ -1599,7 +1603,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures abiword-plugins 2.6.2 to adapt to many kinds of systems. +\`configure' configures abiword-plugins 2.6.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1669,7 +1673,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of abiword-plugins 2.6.2:";; + short | recursive ) echo "Configuration of abiword-plugins 2.6.4:";; esac cat <<\_ACEOF @@ -1764,7 +1768,7 @@ specify the root directory for boost (optional) --with-asio=DIR use ASIO in DIR --with-abicollab-sugar-backend enable the Sugar backend for abicollab - --with-abicollab-service-backend enable the collaborate.abisource.com service backend for abicollab + --with-abicollab-service-backend enable the abicollab.net service backend for abicollab; NOTE to packagers: do NOT enable this, the service is not publically available yet --without-abicommand --without-abidash --without-abigimp @@ -1870,6 +1874,10 @@ C compiler flags for _abi_dbus_glib, overriding pkg-config _abi_dbus_glib_LIBS linker flags for _abi_dbus_glib, overriding pkg-config + ABICOLLAB_SOUP_CFLAGS + C compiler flags for ABICOLLAB_SOUP, overriding pkg-config + ABICOLLAB_SOUP_LIBS + linker flags for ABICOLLAB_SOUP, overriding pkg-config _abi_glib_CFLAGS C compiler flags for _abi_glib, overriding pkg-config _abi_glib_LIBS @@ -2004,7 +2012,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -abiword-plugins configure 2.6.2 +abiword-plugins configure 2.6.4 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -2018,7 +2026,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by abiword-plugins $as_me 2.6.2, which was +It was created by abiword-plugins $as_me 2.6.4, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2504,12 +2512,12 @@ abi_plugin_topdir=`pwd` rm -f $abi_plugin_topdir/plugin.status - if test "x2.6.2" = "x" ; then + if test "x2.6.4" = "x" ; then { { echo "$as_me:$LINENO: error: No AbiWord plugins version number!" >&5 echo "$as_me: error: No AbiWord plugins version number!" >&2;} { (exit 1); exit 1; }; } fi - abi_plugin_version="2.6.2" + abi_plugin_version="2.6.4" abi_plugin_major=`echo $abi_plugin_version | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` abi_plugin_minor=`echo $abi_plugin_version | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` abi_plugin_micro=`echo $abi_plugin_version | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` @@ -7592,7 +7600,7 @@ # Define the identity of the package. PACKAGE='abiword-plugins' - VERSION='2.6.2' + VERSION='2.6.4' cat >>confdefs.h <<_ACEOF @@ -8590,7 +8598,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 8593 "configure"' > conftest.$ac_ext + echo '#line 8601 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10387,11 +10395,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10390: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10398: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10394: \$? = $ac_status" >&5 + echo "$as_me:10402: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -10677,11 +10685,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10680: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10688: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10684: \$? = $ac_status" >&5 + echo "$as_me:10692: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -10781,11 +10789,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10784: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10792: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10788: \$? = $ac_status" >&5 + echo "$as_me:10796: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13132,7 +13140,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:15663: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15659: \$? = $ac_status" >&5 + echo "$as_me:15667: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15756,11 +15764,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15759: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15767: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15763: \$? = $ac_status" >&5 + echo "$as_me:15771: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17320,11 +17328,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17323: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17331: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17327: \$? = $ac_status" >&5 + echo "$as_me:17335: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17424,11 +17432,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17427: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17435: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17431: \$? = $ac_status" >&5 + echo "$as_me:17439: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19613,11 +19621,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19616: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19624: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19620: \$? = $ac_status" >&5 + echo "$as_me:19628: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -19903,11 +19911,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19906: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19914: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19910: \$? = $ac_status" >&5 + echo "$as_me:19918: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -20007,11 +20015,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:20010: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20018: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:20014: \$? = $ac_status" >&5 + echo "$as_me:20022: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23834,7 +23842,7 @@ # -# Checks for the collaborate.abisource.com service backend +# Checks for the abicollab.net service backend # # Check whether --with-abicollab-service-backend was given. @@ -23981,30 +23989,293 @@ #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF + abicollab_handler_service=yes + +else - if test "xabicollab collaborate.abisource.com support: yes" != "x" ; then - echo "abicollab collaborate.abisource.com support: yes" >> $abi_plugin_topdir/plugin.status + if test "xabicollab abicollab.net support: no, asio >= 0.3.8rc1 required" != "x" ; then + echo "abicollab abicollab.net support: no, asio >= 0.3.8rc1 required" >> $abi_plugin_topdir/plugin.status fi - abicollab_handler_service=yes + +fi + +done + + + if test "x$abicollab_handler_service" = "xyes" ; then + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for ABICOLLAB_SOUP" >&5 +echo $ECHO_N "checking for ABICOLLAB_SOUP... $ECHO_C" >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$ABICOLLAB_SOUP_CFLAGS"; then + pkg_cv_ABICOLLAB_SOUP_CFLAGS="$ABICOLLAB_SOUP_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.2 >= 2.2.100\"") >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.2 >= 2.2.100") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_ABICOLLAB_SOUP_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.2 >= 2.2.100" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$ABICOLLAB_SOUP_LIBS"; then + pkg_cv_ABICOLLAB_SOUP_LIBS="$ABICOLLAB_SOUP_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.2 >= 2.2.100\"") >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.2 >= 2.2.100") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_ABICOLLAB_SOUP_LIBS=`$PKG_CONFIG --libs "libsoup-2.2 >= 2.2.100" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + ABICOLLAB_SOUP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libsoup-2.2 >= 2.2.100"` + else + ABICOLLAB_SOUP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libsoup-2.2 >= 2.2.100"` + fi + # Put the nasty error message in config.log where it belongs + echo "$ABICOLLAB_SOUP_PKG_ERRORS" >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for ABICOLLAB_SOUP" >&5 +echo $ECHO_N "checking for ABICOLLAB_SOUP... $ECHO_C" >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$ABICOLLAB_SOUP_CFLAGS"; then + pkg_cv_ABICOLLAB_SOUP_CFLAGS="$ABICOLLAB_SOUP_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.4.1\"") >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.4.1") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_ABICOLLAB_SOUP_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.4 >= 2.4.1" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$ABICOLLAB_SOUP_LIBS"; then + pkg_cv_ABICOLLAB_SOUP_LIBS="$ABICOLLAB_SOUP_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.4.1\"") >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.4.1") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_ABICOLLAB_SOUP_LIBS=`$PKG_CONFIG --libs "libsoup-2.4 >= 2.4.1" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + ABICOLLAB_SOUP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libsoup-2.4 >= 2.4.1"` + else + ABICOLLAB_SOUP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libsoup-2.4 >= 2.4.1"` + fi + # Put the nasty error message in config.log where it belongs + echo "$ABICOLLAB_SOUP_PKG_ERRORS" >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + + + if test "xabicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required" != "x" ; then + echo "abicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required" >> $abi_plugin_topdir/plugin.status + fi + + abicollab_handler_service=no + +elif test $pkg_failed = untried; then + + + if test "xabicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required" != "x" ; then + echo "abicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required" >> $abi_plugin_topdir/plugin.status + fi + + abicollab_handler_service=no else + ABICOLLAB_SOUP_CFLAGS=$pkg_cv_ABICOLLAB_SOUP_CFLAGS + ABICOLLAB_SOUP_LIBS=$pkg_cv_ABICOLLAB_SOUP_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + + ABICOLLAB_SOUP_CFLAGS+=-DSOUP24 - if test "xabicollab collaborate.abisource.com support: no, asio >= 0.3.8rc1 required" != "x" ; then - echo "abicollab collaborate.abisource.com support: no, asio >= 0.3.8rc1 required" >> $abi_plugin_topdir/plugin.status + if test "xabicollab abicollab.net support: yes" != "x" ; then + echo "abicollab abicollab.net support: yes" >> $abi_plugin_topdir/plugin.status fi + abicollab_handler_service=yes fi -done +elif test $pkg_failed = untried; then +pkg_failed=no +{ echo "$as_me:$LINENO: checking for ABICOLLAB_SOUP" >&5 +echo $ECHO_N "checking for ABICOLLAB_SOUP... $ECHO_C" >&6; } +if test -n "$PKG_CONFIG"; then + if test -n "$ABICOLLAB_SOUP_CFLAGS"; then + pkg_cv_ABICOLLAB_SOUP_CFLAGS="$ABICOLLAB_SOUP_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.4.1\"") >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.4.1") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_ABICOLLAB_SOUP_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.4 >= 2.4.1" 2>/dev/null` else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$ABICOLLAB_SOUP_LIBS"; then + pkg_cv_ABICOLLAB_SOUP_LIBS="$ABICOLLAB_SOUP_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.4.1\"") >&5 + ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.4.1") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_ABICOLLAB_SOUP_LIBS=`$PKG_CONFIG --libs "libsoup-2.4 >= 2.4.1" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi - if test "xabicollab collaborate.abisource.com support: no" != "x" ; then - echo "abicollab collaborate.abisource.com support: no" >> $abi_plugin_topdir/plugin.status + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + ABICOLLAB_SOUP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libsoup-2.4 >= 2.4.1"` + else + ABICOLLAB_SOUP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libsoup-2.4 >= 2.4.1"` + fi + # Put the nasty error message in config.log where it belongs + echo "$ABICOLLAB_SOUP_PKG_ERRORS" >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + + + if test "xabicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required" != "x" ; then + echo "abicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required" >> $abi_plugin_topdir/plugin.status + fi + + abicollab_handler_service=no + +elif test $pkg_failed = untried; then + + + if test "xabicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required" != "x" ; then + echo "abicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required" >> $abi_plugin_topdir/plugin.status + fi + + abicollab_handler_service=no + +else + ABICOLLAB_SOUP_CFLAGS=$pkg_cv_ABICOLLAB_SOUP_CFLAGS + ABICOLLAB_SOUP_LIBS=$pkg_cv_ABICOLLAB_SOUP_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + + ABICOLLAB_SOUP_CFLAGS+=-DSOUP24 + + if test "xabicollab abicollab.net support: yes" != "x" ; then + echo "abicollab abicollab.net support: yes" >> $abi_plugin_topdir/plugin.status + fi + + abicollab_handler_service=yes + +fi + +else + ABICOLLAB_SOUP_CFLAGS=$pkg_cv_ABICOLLAB_SOUP_CFLAGS + ABICOLLAB_SOUP_LIBS=$pkg_cv_ABICOLLAB_SOUP_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + + + if test "xabicollab abicollab.net support: yes" != "x" ; then + echo "abicollab abicollab.net support: yes" >> $abi_plugin_topdir/plugin.status + fi + + abicollab_handler_service=yes + +fi + fi + + +else + + + if test "xabicollab abicollab.net support: no" != "x" ; then + echo "abicollab abicollab.net support: no" >> $abi_plugin_topdir/plugin.status fi abicollab_handler_service=no @@ -24012,8 +24283,8 @@ fi if test "x$abicollab_handler_service" = "xyes" ; then - ABICOLLAB_SERVICE_CPPFLAGS="-DABICOLLAB_HANDLER_SERVICE $ABICOLLAB_ASIO_CPPFLAGS" - ABICOLLAB_SERVICE_LIBS="-lpthread" + ABICOLLAB_SERVICE_CPPFLAGS="-DABICOLLAB_HANDLER_SERVICE $ABICOLLAB_ASIO_CPPFLAGS $ABICOLLAB_SOUP_CFLAGS" + ABICOLLAB_SERVICE_LIBS="-lpthread $ABICOLLAB_SOUP_LIBS" fi @@ -31886,7 +32157,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by abiword-plugins $as_me 2.6.2, which was +This file was extended by abiword-plugins $as_me 2.6.4, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31933,7 +32204,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -abiword-plugins config.status 2.6.2 +abiword-plugins config.status 2.6.4 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -32436,6 +32707,8 @@ _abi_dbus_glib_LIBS!$_abi_dbus_glib_LIBS$ac_delim ABICOLLAB_SUGAR_CPPFLAGS!$ABICOLLAB_SUGAR_CPPFLAGS$ac_delim ABICOLLAB_SUGAR_LIBS!$ABICOLLAB_SUGAR_LIBS$ac_delim +ABICOLLAB_SOUP_CFLAGS!$ABICOLLAB_SOUP_CFLAGS$ac_delim +ABICOLLAB_SOUP_LIBS!$ABICOLLAB_SOUP_LIBS$ac_delim ABICOLLAB_SERVICE_CPPFLAGS!$ABICOLLAB_SERVICE_CPPFLAGS$ac_delim ABICOLLAB_SERVICE_LIBS!$ABICOLLAB_SERVICE_LIBS$ac_delim ABICOLLAB_HANDLER_FAKE_TRUE!$ABICOLLAB_HANDLER_FAKE_TRUE$ac_delim @@ -32480,8 +32753,6 @@ ABI_GDA_CPPFLAGS!$ABI_GDA_CPPFLAGS$ac_delim ABI_GDA_LDFLAGS!$ABI_GDA_LDFLAGS$ac_delim _abi_gtk_CFLAGS!$_abi_gtk_CFLAGS$ac_delim -_abi_gtk_LIBS!$_abi_gtk_LIBS$ac_delim -ABI_GDICT_CPPFLAGS!$ABI_GDICT_CPPFLAGS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -32523,6 +32794,8 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +_abi_gtk_LIBS!$_abi_gtk_LIBS$ac_delim +ABI_GDICT_CPPFLAGS!$ABI_GDICT_CPPFLAGS$ac_delim ABI_GDICT_LDFLAGS!$ABI_GDICT_LDFLAGS$ac_delim LOADBINDINGS_CPPFLAGS!$LOADBINDINGS_CPPFLAGS$ac_delim LOADBINDINGS_LDFLAGS!$LOADBINDINGS_LDFLAGS$ac_delim @@ -32588,7 +32861,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 63; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 65; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/configure.ac /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/configure.ac --- abiword-2.6.2/abiword-plugins/configure.ac 2008-04-06 22:37:25.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/configure.ac 2008-07-13 14:09:35.000000000 +0100 @@ -1,9 +1,9 @@ -AC_INIT([abiword-plugins], 2.6.2, [http://bugzilla.abisource.com/]) +AC_INIT([abiword-plugins], 2.6.4, [http://bugzilla.abisource.com/]) AC_CONFIG_SRCDIR([ac-helpers/abi-plugin-init.m4]) dnl First of all AbiWord plugin macros: dnl -ABI_PLUGIN_INIT(2.6.2) +ABI_PLUGIN_INIT(2.6.4) ABI_PLUGIN_CONFIG # Checks for programs. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/GNUmakefile.in 2008-04-06 22:38:02.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/GNUmakefile.in 2008-07-13 14:10:28.000000000 +0100 @@ -81,6 +81,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/GNUmakefile.in 2008-04-06 22:37:36.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/GNUmakefile.in 2008-07-13 14:09:55.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/xp/FakeAccountHandler.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/xp/FakeAccountHandler.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/xp/FakeAccountHandler.cpp 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/xp/FakeAccountHandler.cpp 2008-07-13 13:05:19.000000000 +0100 @@ -293,7 +293,7 @@ } addBuddy(pCollaborator); - m_pSession = new AbiCollab(sSessionId, m_pDoc, sDocUUID /* FIXME: this is the local doc uuid, is that valid?? */, jsrre.m_iRev, pCollaborator, true); + m_pSession = new AbiCollab(sSessionId, m_pDoc, sDocUUID /* FIXME: this is the local doc uuid, is that valid?? */, jsrre.m_iRev, pCollaborator, false, true); pManager->joinSession(m_pSession, pCollaborator); } @@ -368,7 +368,7 @@ } // a remote m_packets has been received; let it walk the normal path for incoming m_packets - pManager->processPacket(*this, sp, rp.m_buddyName.utf8_str()); + pManager->processPacket(*this, sp, getBuddy(rp.m_buddyName)); } else { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/xp/FakeAccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/xp/FakeAccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/xp/FakeAccountHandler.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/xp/FakeAccountHandler.h 2008-07-13 13:05:19.000000000 +0100 @@ -28,7 +28,7 @@ class FakeBuddy; class PD_Document; -class ABI_EXPORT FakeAccountHandler : public AccountHandler +class FakeAccountHandler : public AccountHandler { public: FakeAccountHandler(const UT_UTF8String& sSessionURI, XAP_Frame* pFrame); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/xp/FakeBuddy.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/xp/FakeBuddy.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/xp/FakeBuddy.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/xp/FakeBuddy.h 2008-07-13 13:05:19.000000000 +0100 @@ -27,7 +27,7 @@ class DocHandle; -ABI_EXPORT class FakeBuddy : public Buddy + class FakeBuddy : public Buddy { public: FakeBuddy(AccountHandler* handler, const UT_UTF8String& name) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/fake/xp/GNUmakefile.in 2008-04-06 22:37:36.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/fake/xp/GNUmakefile.in 2008-07-13 14:09:55.000000000 +0100 @@ -88,6 +88,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/GNUmakefile.in 2008-04-06 22:37:36.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/GNUmakefile.in 2008-07-13 14:09:54.000000000 +0100 @@ -72,6 +72,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/Makefile 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/Makefile 2008-07-13 13:05:21.000000000 +0100 @@ -20,13 +20,22 @@ ABI_ROOT:=$(shell pwd)/../../../../abi include $(ABI_ROOT)/src/config/abi_defs.mk +include $(shell pwd)/../abicollab_config.mk -DIRS= xp tcp +DIRS= xp + +ifeq ($(BUILD_TCP_BACKEND),1) +DIRS += tcp +endif + +ifeq ($(BUILD_SERVICE_BACKEND),1) +DIRS += service +endif TARGETS= $(OBJS) -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/cacert.pem /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/cacert.pem --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/cacert.pem 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/cacert.pem 2008-07-13 13:05:18.000000000 +0100 @@ -0,0 +1,69 @@ +## +## ca-bundle.crt -- Bundle of CA Root Certificates +## Converted by the service run by Daniel Stenberg +## URL: http://curl.haxx.se/docs/caextract.html +## Converted at: Wed Jun 4 03:12:09 UTC 2008 +CVS_ID "@(#) $RCSfile: certdata.txt,v $ $Revision: 1.47.2.1 $ $Date: 2008/05/03 03:13:22 $" +## +## This is a bundle of X.509 certificates of public Certificate Authorities +## (CA). These were automatically extracted from Mozilla's root certificates +## file (certdata.txt). This file can be found in the mozilla source tree: +## '/mozilla/security/nss/lib/ckfw/builtins/certdata.txt' +## +## This file was automatically converted and downloaded through the services +## provided by http://curl.haxx.se/docs/caextract.html +## +## +## The contents of this file are subject to the Mozilla Public License Version +## 1.1 (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## http://www.mozilla.org/MPL/ +## +## Software distributed under the License is distributed on an "AS IS" basis, +## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +## for the specific language governing rights and limitations under the +## License. +## +## The Original Code is the Netscape security libraries. +## +## The Initial Developer of the Original Code is Netscape Communications +## Corporation. Portions created by Netscape are Copyright (C) 1994-2000 +## Netscape Communications Corporation. All Rights Reserved. +## +## Contributor(s): +## +## Alternatively, the contents of this file may be used under the terms of the +## GNU General Public License Version 2 or later (the "GPL"), in which case +## the provisions of the GPL are applicable instead of those above. If you +## wish to allow use of your version of this file only under the terms of the +## GPL and not to allow others to use your version of this file under the MPL, +## indicate your decision by deleting the provisions above and replace them +## with the notice and other provisions required by the GPL. If you do not +## delete the provisions above, a recipient may use your version of this file +## under either the MPL or the GPL. +## +## +## Sat Jun 07 2008 - stripped all CA Root Certificates except the +## Thawte Premium Server CA, which is the only one the abicollab.net backend +## for the AbiWord AbiCollab plugin needs. - Marc Maurer + +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy +dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t +MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB +MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG +A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp +b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl +cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv +bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE +VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ +ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR +uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG +9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI +hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM +pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- + diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/GNUmakefile.am /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/GNUmakefile.am --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/GNUmakefile.am 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/GNUmakefile.am 2008-07-13 13:05:18.000000000 +0100 @@ -1 +1,10 @@ -SUBDIRS = unix xp \ No newline at end of file +SUBDIRS = unix xp + +# TODO: fix the hardcoded cert dir +certdir=$(datadir)/abiword-2.6/certs + +cert_DATA = \ + cacert.pem + +EXTRA_DIST = \ + $(cert_DATA) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/GNUmakefile.in 2008-04-06 22:37:36.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/GNUmakefile.in 2008-07-13 14:09:55.000000000 +0100 @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -55,6 +56,15 @@ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(certdir)" +certDATA_INSTALL = $(INSTALL_DATA) +DATA = $(cert_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags @@ -67,6 +77,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ @@ -295,6 +307,15 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = unix xp + +# TODO: fix the hardcoded cert dir +certdir = $(datadir)/abiword-2.6/certs +cert_DATA = \ + cacert.pem + +EXTRA_DIST = \ + $(cert_DATA) + all: all-recursive .SUFFIXES: @@ -333,6 +354,23 @@ clean-libtool: -rm -rf .libs _libs +install-certDATA: $(cert_DATA) + @$(NORMAL_INSTALL) + test -z "$(certdir)" || $(MKDIR_P) "$(DESTDIR)$(certdir)" + @list='$(cert_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(certDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(certdir)/$$f'"; \ + $(certDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(certdir)/$$f"; \ + done + +uninstall-certDATA: + @$(NORMAL_UNINSTALL) + @list='$(cert_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(certdir)/$$f'"; \ + rm -f "$(DESTDIR)$(certdir)/$$f"; \ + done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -510,9 +548,12 @@ done check-am: all-am check: check-recursive -all-am: GNUmakefile +all-am: GNUmakefile $(DATA) installdirs: installdirs-recursive installdirs-am: + for dir in "$(DESTDIR)$(certdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -555,7 +596,7 @@ info-am: -install-data-am: +install-data-am: install-certDATA install-dvi: install-dvi-recursive @@ -589,7 +630,7 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-certDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip @@ -598,15 +639,15 @@ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am + html-am info info-am install install-am install-certDATA \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-certDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.cpp 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.cpp 2008-07-13 13:05:16.000000000 +0100 @@ -0,0 +1,124 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include "xap_App.h" +#include "ap_UnixApp.h" +#include "xap_UnixApp.h" +#include "xap_Frame.h" +#include "xap_UnixDialogHelper.h" +#include "ut_string_class.h" +#include + +#include "ap_UnixDialog_GenericInput.h" + +static void s_ok_clicked(GtkWidget * wid, AP_UnixDialog_GenericInput * dlg) +{ + dlg->event_Ok(); +} + +XAP_Dialog * AP_UnixDialog_GenericInput::static_constructor(XAP_DialogFactory * pFactory, XAP_Dialog_Id id) +{ + return static_cast(new AP_UnixDialog_GenericInput(pFactory, id)); +} +pt2Constructor ap_Dialog_GenericInput_Constructor = &AP_UnixDialog_GenericInput::static_constructor; + +AP_UnixDialog_GenericInput::AP_UnixDialog_GenericInput(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id) + : AP_Dialog_GenericInput(pDlgFactory, id), + m_wWindowMain(NULL), + m_wOk(NULL) +{ +} + +void AP_UnixDialog_GenericInput::runModal(XAP_Frame * pFrame) +{ + UT_return_if_fail(pFrame); + + // Build the dialog's window + m_wWindowMain = _constructWindow(); + UT_return_if_fail(m_wWindowMain); + + _populateWindowData(); + + switch ( abiRunModalDialog ( GTK_DIALOG(m_wWindowMain), + pFrame, this, GTK_RESPONSE_CANCEL, false ) ) + { + case GTK_RESPONSE_CANCEL: + m_answer = AP_UnixDialog_GenericInput::a_CANCEL; + break; + case GTK_RESPONSE_OK: + m_answer = AP_UnixDialog_GenericInput::a_OK; + break; + default: + m_answer = AP_UnixDialog_GenericInput::a_CANCEL; + break; + } + + abiDestroyWidget(m_wWindowMain); +} + +/*****************************************************************/ +GtkWidget * AP_UnixDialog_GenericInput::_constructWindow(void) +{ + GtkWidget* window; + //const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); + + // get the path where our glade file is located + XAP_UnixApp * pApp = static_cast(XAP_App::getApp()); + UT_String glade_path( pApp->getAbiSuiteAppGladeDir() ); + glade_path += "/ap_UnixDialog_GenericInput.glade"; + // load the dialog from the glade file + GladeXML *xml = abiDialogNewFromXML( glade_path.c_str() ); + if (!xml) + return NULL; + + // Update our member variables with the important widgets that + // might need to be queried or altered later + window = glade_xml_get_widget(xml, "ap_UnixDialog_GenericInput"); + m_wOk = glade_xml_get_widget(xml, "btOK"); + m_wInput = glade_xml_get_widget(xml, "edInput"); + + // set the dialog title + abiDialogSetTitle(window, getTitle().utf8_str()); + + // set the question + gtk_label_set_text(GTK_LABEL(glade_xml_get_widget(xml, "lbQuestion")), getQuestion().utf8_str()); + gtk_label_set_text(GTK_LABEL(glade_xml_get_widget(xml, "lbLabel")), getLabel().utf8_str()); + + // connect our signals + g_signal_connect(G_OBJECT(m_wOk), + "clicked", + G_CALLBACK(s_ok_clicked), + static_cast(this)); + + return window; +} + +void AP_UnixDialog_GenericInput::_populateWindowData() +{ + // set the focus on the text input + // TODO: implement me + + // set the password style input if requested + gtk_entry_set_visibility(GTK_ENTRY(m_wInput), !isPassword()); +} + +void AP_UnixDialog_GenericInput::event_Ok() +{ + _setInput(gtk_entry_get_text(GTK_ENTRY(m_wInput))); +} + diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.glade /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.glade --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.glade 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.glade 2008-07-13 13:05:16.000000000 +0100 @@ -0,0 +1,223 @@ + + + + + + + + 5 + Input + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 18 + + + + True + 2 + 2 + False + 6 + 0 + + + + True + %s + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 2 + 0 + 1 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + 1 + 2 + False + 0 + 6 + + + + True + %s: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + True + True + 0 + + True + + False + + + 1 + 2 + 0 + 1 + + + + + + 1 + 2 + 1 + 2 + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericInput.h 2008-07-13 13:05:16.000000000 +0100 @@ -0,0 +1,45 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef AP_UNIXDIALOG_GENERICINPUT_H +#define AP_UNIXDIALOG_GENERICINPUT_H + +#include +#include + +class XAP_Frame; + +class AP_UnixDialog_GenericInput : public AP_Dialog_GenericInput +{ +public: + AP_UnixDialog_GenericInput(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); + static XAP_Dialog * static_constructor(XAP_DialogFactory * pFactory, XAP_Dialog_Id id); + void runModal(XAP_Frame * pFrame); + + void event_Ok(); + +private: + GtkWidget* _constructWindow(void); + void _populateWindowData(void); + + GtkWidget* m_wWindowMain; + GtkWidget* m_wOk; + GtkWidget* m_wInput; +}; + +#endif /* AP_UNIXDIALOG_GENERICINPUT_H */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.cpp 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.cpp 2008-07-13 13:05:16.000000000 +0100 @@ -0,0 +1,119 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include "xap_App.h" +#include "ap_UnixApp.h" +#include "xap_UnixApp.h" +#include "xap_Frame.h" +#include "xap_UnixDialogHelper.h" +#include "ut_string_class.h" +#include + +#include "ap_UnixDialog_GenericProgress.h" + +XAP_Dialog * AP_UnixDialog_GenericProgress::static_constructor(XAP_DialogFactory * pFactory, XAP_Dialog_Id id) +{ + return static_cast(new AP_UnixDialog_GenericProgress(pFactory, id)); +} +pt2Constructor ap_Dialog_GenericProgress_Constructor = &AP_UnixDialog_GenericProgress::static_constructor; + +AP_UnixDialog_GenericProgress::AP_UnixDialog_GenericProgress(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id) + : AP_Dialog_GenericProgress(pDlgFactory, id), + m_wWindowMain(NULL), + m_wCancel(NULL), + m_wProgress(NULL) +{ +} + +void AP_UnixDialog_GenericProgress::runModal(XAP_Frame * pFrame) +{ + UT_return_if_fail(pFrame); + + // Build the dialog's window + m_wWindowMain = _constructWindow(); + UT_return_if_fail(m_wWindowMain); + + _populateWindowData(); + + switch ( abiRunModalDialog ( GTK_DIALOG(m_wWindowMain), + pFrame, this, AP_Dialog_GenericProgress::a_CANCEL, false ) ) + { + case GTK_RESPONSE_CANCEL: + m_answer = AP_Dialog_GenericProgress::a_CANCEL; + break; + case GTK_RESPONSE_OK: + m_answer = AP_Dialog_GenericProgress::a_OK; + break; + default: + m_answer = AP_Dialog_GenericProgress::a_OK; + break; + } + + abiDestroyWidget(m_wWindowMain); +} + +void AP_UnixDialog_GenericProgress::close() +{ + UT_return_if_fail(m_wWindowMain); + gtk_dialog_response(GTK_DIALOG(m_wWindowMain), AP_Dialog_GenericProgress::a_OK); +} + +void AP_UnixDialog_GenericProgress::setProgress(UT_uint32 progress) +{ + UT_return_if_fail(m_wProgress); + UT_return_if_fail(progress >= 0 && progress <= 100); + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(m_wProgress), progress / 100.0f); +} + +/*****************************************************************/ +GtkWidget * AP_UnixDialog_GenericProgress::_constructWindow(void) +{ + GtkWidget* window; + //const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); + + // get the path where our glade file is located + XAP_UnixApp * pApp = static_cast(XAP_App::getApp()); + UT_String glade_path( pApp->getAbiSuiteAppGladeDir() ); + glade_path += "/ap_UnixDialog_GenericProgress.glade"; + // load the dialog from the glade file + GladeXML *xml = abiDialogNewFromXML( glade_path.c_str() ); + if (!xml) + return NULL; + + // Update our member variables with the important widgets that + // might need to be queried or altered later + window = glade_xml_get_widget(xml, "ap_UnixDialog_GenericProgress"); + m_wCancel = glade_xml_get_widget(xml, "btCancel"); + m_wProgress = glade_xml_get_widget(xml, "pbProgress"); + + // set the dialog title + abiDialogSetTitle(window, getTitle().utf8_str()); + + // set the informative label + gtk_label_set_text(GTK_LABEL(glade_xml_get_widget(xml, "lbInformation")), getInformation().utf8_str()); + //gtk_label_set_text(GTK_LABEL(glade_xml_get_widget(xml, "lbLabel")), getLabel().utf8_str()); + + return window; +} + +void AP_UnixDialog_GenericProgress::_populateWindowData() +{ + // set the focus on the text input + // TODO: implement me +} + diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.glade /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.glade --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.glade 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.glade 2008-07-13 13:05:16.000000000 +0100 @@ -0,0 +1,134 @@ + + + + + + + + 5 + Please wait... + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + False + + + + True + False + 2 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 18 + + + + True + 2 + 1 + False + 6 + 0 + + + + True + %s + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + + PANGO_ELLIPSIZE_NONE + + + 0 + 1 + 1 + 2 + + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ap_UnixDialog_GenericProgress.h 2008-07-13 13:05:16.000000000 +0100 @@ -0,0 +1,46 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef AP_UNIXDIALOG_GENERICPROGRESS_H +#define AP_UNIXDIALOG_GENERICPROGRESS_H + +#include +#include + +class XAP_Frame; + +class AP_UnixDialog_GenericProgress : public AP_Dialog_GenericProgress +{ +public: + AP_UnixDialog_GenericProgress(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); + static XAP_Dialog * static_constructor(XAP_DialogFactory * pFactory, XAP_Dialog_Id id); + void runModal(XAP_Frame * pFrame); + + virtual void close(); + virtual void setProgress(UT_uint32 progress); + +private: + GtkWidget* _constructWindow(void); + void _populateWindowData(void); + + GtkWidget* m_wWindowMain; + GtkWidget* m_wCancel; + GtkWidget* m_wProgress; +}; + +#endif /* AP_UNIXDIALOG_GENERICPROGRESS_H */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/GNUmakefile.am /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/GNUmakefile.am --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/GNUmakefile.am 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/GNUmakefile.am 2008-07-13 13:05:16.000000000 +0100 @@ -1,17 +1,33 @@ CPPFLAGS = \ -I$(srcdir) \ + -I$(srcdir)/.. \ -I$(srcdir)/../../.. \ -I$(srcdir)/../../../core/packet \ + -I$(srcdir)/../../../core/session \ @ABI_CPPFLAGS@ @CPPFLAGS@ @ABICOLLAB_SERVICE_CPPFLAGS@ @PLATFORM_CPPFLAGS@ LDFLAGS = @LDFLAGS@ @ABICOLLAB_SERVICE_LIBS@ @PLATFORM_LDFLAGS@ +# TODO: fix the hardcoded glade dir +gladedir=$(datadir)/abiword-2.6/glade + +glade_DATA = \ + ap_UnixDialog_GenericInput.glade \ + ap_UnixDialog_GenericProgress.glade + noinst_LTLIBRARIES = libAbiCollabServiceUnixHandler.la libAbiCollabServiceUnixHandler_la_SOURCES = \ + ap_UnixDialog_GenericInput.cpp \ + ap_UnixDialog_GenericInput.h \ + ap_UnixDialog_GenericProgress.cpp \ + ap_UnixDialog_GenericProgress.h \ ServiceUnixAccountHandler.cpp \ ServiceUnixAccountHandler.h libAbiCollabServiceUnixHandler_la_LIBADD= @ABI_LIBS@ libAbiCollabServiceUnixHandler_la_LDFLAGS = -no-undefined -module -avoid-version + +EXTRA_DIST = \ + $(glade_DATA) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/GNUmakefile.in 2008-04-06 22:37:36.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/GNUmakefile.in 2008-07-13 14:09:55.000000000 +0100 @@ -14,6 +14,7 @@ @SET_MAKE@ + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -50,6 +51,7 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libAbiCollabServiceUnixHandler_la_DEPENDENCIES = am_libAbiCollabServiceUnixHandler_la_OBJECTS = \ + ap_UnixDialog_GenericInput.lo ap_UnixDialog_GenericProgress.lo \ ServiceUnixAccountHandler.lo libAbiCollabServiceUnixHandler_la_OBJECTS = \ $(am_libAbiCollabServiceUnixHandler_la_OBJECTS) @@ -80,6 +82,15 @@ $(LDFLAGS) -o $@ SOURCES = $(libAbiCollabServiceUnixHandler_la_SOURCES) DIST_SOURCES = $(libAbiCollabServiceUnixHandler_la_SOURCES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(gladedir)" +gladeDATA_INSTALL = $(INSTALL_DATA) +DATA = $(glade_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -89,6 +100,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ @@ -148,8 +161,10 @@ CPP = @CPP@ CPPFLAGS = \ -I$(srcdir) \ + -I$(srcdir)/.. \ -I$(srcdir)/../../.. \ -I$(srcdir)/../../../core/packet \ + -I$(srcdir)/../../../core/session \ @ABI_CPPFLAGS@ @CPPFLAGS@ @ABICOLLAB_SERVICE_CPPFLAGS@ @PLATFORM_CPPFLAGS@ CXX = @CXX@ @@ -321,13 +336,27 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ + +# TODO: fix the hardcoded glade dir +gladedir = $(datadir)/abiword-2.6/glade +glade_DATA = \ + ap_UnixDialog_GenericInput.glade \ + ap_UnixDialog_GenericProgress.glade + noinst_LTLIBRARIES = libAbiCollabServiceUnixHandler.la libAbiCollabServiceUnixHandler_la_SOURCES = \ + ap_UnixDialog_GenericInput.cpp \ + ap_UnixDialog_GenericInput.h \ + ap_UnixDialog_GenericProgress.cpp \ + ap_UnixDialog_GenericProgress.h \ ServiceUnixAccountHandler.cpp \ ServiceUnixAccountHandler.h libAbiCollabServiceUnixHandler_la_LIBADD = @ABI_LIBS@ libAbiCollabServiceUnixHandler_la_LDFLAGS = -no-undefined -module -avoid-version +EXTRA_DIST = \ + $(glade_DATA) + all: all-am .SUFFIXES: @@ -380,6 +409,8 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ServiceUnixAccountHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ap_UnixDialog_GenericInput.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ap_UnixDialog_GenericProgress.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -407,6 +438,23 @@ clean-libtool: -rm -rf .libs _libs +install-gladeDATA: $(glade_DATA) + @$(NORMAL_INSTALL) + test -z "$(gladedir)" || $(MKDIR_P) "$(DESTDIR)$(gladedir)" + @list='$(glade_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(gladeDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(gladedir)/$$f'"; \ + $(gladeDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(gladedir)/$$f"; \ + done + +uninstall-gladeDATA: + @$(NORMAL_UNINSTALL) + @list='$(glade_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(gladedir)/$$f'"; \ + rm -f "$(DESTDIR)$(gladedir)/$$f"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -484,8 +532,11 @@ done check-am: all-am check: check-am -all-am: GNUmakefile $(LTLIBRARIES) +all-am: GNUmakefile $(LTLIBRARIES) $(DATA) installdirs: + for dir in "$(DESTDIR)$(gladedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -531,7 +582,7 @@ info-am: -install-data-am: +install-data-am: install-gladeDATA install-dvi: install-dvi-am @@ -567,7 +618,7 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-gladeDATA .MAKE: install-am install-strip @@ -576,13 +627,14 @@ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am + install-dvi-am install-exec install-exec-am install-gladeDATA \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-gladeDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ServiceUnixAccountHandler.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ServiceUnixAccountHandler.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ServiceUnixAccountHandler.cpp 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ServiceUnixAccountHandler.cpp 2008-07-13 13:05:16.000000000 +0100 @@ -43,7 +43,7 @@ GtkVBox* parent = (GtkVBox*)pEmbeddingParent; // username - GtkWidget* username_label = gtk_label_new("Username:"); + GtkWidget* username_label = gtk_label_new("E-mail address:"); gtk_misc_set_alignment(GTK_MISC(username_label), 0, 0.5); gtk_table_attach_defaults(GTK_TABLE(table), username_label, 0, 1, 0, 1); username_entry = gtk_entry_new(); @@ -80,8 +80,10 @@ { UT_DEBUGMSG(("ServiceUnixAccountHandler::storeProperties()\n")); + addProperty("uri", "https://abicollab.net/soap/"); + if (username_entry && GTK_IS_ENTRY(username_entry)) - addProperty("username", gtk_entry_get_text(GTK_ENTRY(username_entry))); + addProperty("email", gtk_entry_get_text(GTK_ENTRY(username_entry))); if (password_entry && GTK_IS_ENTRY(password_entry)) addProperty("password", gtk_entry_get_text(GTK_ENTRY(password_entry))); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ServiceUnixAccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ServiceUnixAccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/unix/ServiceUnixAccountHandler.h 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/unix/ServiceUnixAccountHandler.h 2008-07-13 13:05:16.000000000 +0100 @@ -1,4 +1,5 @@ /* Copyright (C) 2006,2007 Marc Maurer + * Copyright (C) 2008 AbiSource Corporation B.V. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabImport.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabImport.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabImport.cpp 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabImport.cpp 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,260 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include +#include "xap_App.h" +#include "xap_DialogFactory.h" +#include "ServiceAccountHandler.h" +#include "ap_Dialog_GenericInput.h" +#include +#include "AbiCollabImport.h" +#include "ServiceErrorCodes.h" + +class XmlDocDeleter { +public: + void operator()(xmlDocPtr* doc) { + if (!doc || !*doc) + return; + xmlFreeDoc(*doc); + } +}; + +IE_Imp_AbiCollabSniffer abicollab_sniffer; // FIXME: this is not really nice if we allow plugin-unloading in the future again + +IE_Imp_AbiCollabSniffer::IE_Imp_AbiCollabSniffer() + : IE_ImpSniffer("AbiWord::AbiCollab-1.0") +{ + IE_Imp::registerImporter(this); +} + +IE_Imp_AbiCollabSniffer::~IE_Imp_AbiCollabSniffer() +{ + IE_Imp::unregisterImporter(this); +} + +static IE_SuffixConfidence IE_Imp_AbiCollabSniffer__SuffixConfidence[] = { + { "abicollab", UT_CONFIDENCE_PERFECT }, + { "", UT_CONFIDENCE_ZILCH } +}; + +const IE_SuffixConfidence * IE_Imp_AbiCollabSniffer::getSuffixConfidence () +{ + return IE_Imp_AbiCollabSniffer__SuffixConfidence; +} + +UT_Confidence_t IE_Imp_AbiCollabSniffer::recognizeContents (const char * szBuf, UT_uint32 iNumbytes) +{ + std::string contents(szBuf, iNumbytes); + if (contents.find("") != std::string::npos && + contents.find("") != std::string::npos && + contents.find("") != std::string::npos && + contents.find("") != std::string::npos) + return UT_CONFIDENCE_PERFECT; + return UT_CONFIDENCE_ZILCH; +} + +bool IE_Imp_AbiCollabSniffer::getDlgLabels (const char ** pszDesc, const char ** pszSuffixList, IEFileType * ft) +{ + // TODO: should we hide this from the menu ? + *pszDesc = "Collaborative File Descriptor (.abicollab)"; + *pszSuffixList = "*.abicollab"; + *ft = getFileType(); + return true; +} + +UT_Error IE_Imp_AbiCollabSniffer::constructImporter (PD_Document * pDocument, IE_Imp ** ppie) +{ + *ppie = new IE_Imp_AbiCollab(pDocument); + return UT_OK; +} + +// ****** +// ** IE_Imp_AbiCollab +// ****** + +IE_Imp_AbiCollab::IE_Imp_AbiCollab(PD_Document* pDocument) + : IE_Imp(pDocument) +{ + UT_DEBUGMSG(("IE_Imp_AbiCollab::IE_Imp_AbiCollab()\n")); +} + +UT_Error IE_Imp_AbiCollab::_loadFile(GsfInput * input) +{ + UT_DEBUGMSG(("IE_Imp_AbiCollab::_loadFile()\n")); + UT_return_val_if_fail(input, UT_ERROR); + + std::string email; + std::string server; + UT_sint64 doc_id; + UT_sint64 revision; + + // get the information needed to open the document + if (!_parse(input, email, server, doc_id, revision)) + return UT_ERROR; + + // get an account handler to use for these settings + ServiceAccountHandler* pAccount = _getAccount(email, server); + UT_return_val_if_fail(pAccount, UT_ERROR); + + return _openDocument(input, pAccount, email, server, doc_id, revision); +} + +UT_Error IE_Imp_AbiCollab::_openDocument(GsfInput * input, ServiceAccountHandler* pAccount, + const std::string& email, const std::string& server, UT_sint64 doc_id, UT_sint64 revision) +{ + UT_DEBUGMSG(("IE_Imp_AbiCollab::_openDocument()\n")); + UT_return_val_if_fail(input, UT_ERROR); + UT_return_val_if_fail(pAccount, UT_ERROR); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_val_if_fail(pManager, UT_ERROR); + + // NOTE: the document id is a valid session identifier, as abicollab.net + // has one ever lasting session per document really + PD_Document* pDoc = getDoc(); + UT_return_val_if_fail(pDoc, UT_ERROR); + UT_ASSERT_HARMLESS(XAP_App::getApp()->getLastFocussedFrame() != NULL); + acs::SOAP_ERROR err = pAccount->openDocument(doc_id, revision, + boost::lexical_cast(doc_id), + &pDoc, XAP_App::getApp()->getLastFocussedFrame()); + switch (err) + { + case acs::SOAP_ERROR_OK: + return UT_OK; + case acs::SOAP_ERROR_INVALID_PASSWORD: + { + // TODO: asking for user input is not really nice in an async function + std::string password; + if (ServiceAccountHandler::askPassword(email, password)) + { + // try again with the new password + pAccount->addProperty("password", password); + pManager->storeProfile(); + return _openDocument(input, pAccount, email, server, doc_id, revision); + } + } + break; + default: + return UT_ERROR; + } + + return UT_ERROR; +} + +bool IE_Imp_AbiCollab::_parse(GsfInput * input, std::string& email, std::string& server, UT_sint64& doc_id, UT_sint64& revision) +{ + guint8 const* contents = gsf_input_read(input, gsf_input_size(input), NULL); + UT_return_val_if_fail(contents, UT_ERROR); + + // FIXME: put this in a boost shared ptr + xmlDocPtr reader = xmlReadMemory(reinterpret_cast(contents), + strlen(reinterpret_cast(contents)), 0, "UTF-8", 0); + UT_return_val_if_fail(reader, UT_ERROR); + boost::shared_ptr reader_ptr(&reader, XmlDocDeleter()); + + xmlNode* root = xmlDocGetRootElement(*reader_ptr); + UT_return_val_if_fail(root, false); + UT_return_val_if_fail(strcmp(reinterpret_cast(root->name), "abicollab") == 0, false); + + std::string doc_id_; + std::string revision_; + for (xmlNode* child = root->children; child; child = child->next) + { + if (child->type != XML_ELEMENT_NODE) + continue; + if (strcmp(reinterpret_cast(child->name), "email") == 0) + email = reinterpret_cast(xmlNodeGetContent(child)); // FIXME: memory leak + else if (strcmp(reinterpret_cast(child->name), "server") == 0) + server = reinterpret_cast(xmlNodeGetContent(child)); // FIXME: memory leak + else if (strcmp(reinterpret_cast(child->name), "doc_id") == 0) + doc_id_ = reinterpret_cast(xmlNodeGetContent(child)); // FIXME: memory leak + else if (strcmp(reinterpret_cast(child->name), "revision") == 0) + revision_ = reinterpret_cast(xmlNodeGetContent(child)); // FIXME: memory leak + } + + UT_return_val_if_fail(email != "" && server != "" && doc_id_ != "" && revision_ != "", false); + + try { + doc_id = boost::lexical_cast(doc_id_); + } catch (boost::bad_lexical_cast &) { + UT_DEBUGMSG(("Error casting doc_id (%s) to an UT_sint64\n", doc_id_.c_str())); + return false; + } + + try { + revision = boost::lexical_cast(revision_); + } catch (boost::bad_lexical_cast &) { + UT_DEBUGMSG(("Error casting revision (%s) to an UT_sint64\n", revision_.c_str())); + return false; + } + + return true; +} + +ServiceAccountHandler* IE_Imp_AbiCollab::_getAccount(const std::string& email, const std::string& server) +{ + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_val_if_fail(pManager, NULL); + + // check if we already have an account handler for this server; + // if not, we'll create it + ServiceAccountHandler* pExistingServiceAccount = NULL; + const UT_GenericVector accounts = pManager->getAccounts(); + for (UT_sint32 i = 0; i < accounts.getItemCount(); i++) + { + AccountHandler* pAccount = accounts.getNthItem(i); + UT_continue_if_fail(pAccount); + // FIXME: don't hardcode this storage type; make it a static class variable + if (pAccount->getStorageType() == "com.abisource.abiword.abicollab.backend.service") + { + ServiceAccountHandler* pServiceAccount = static_cast(pAccount); + // TODO: check trailing '/' for the server name + if (pServiceAccount->getProperty("uri") == server && + pServiceAccount->getProperty("email") == email) + { + UT_DEBUGMSG(("Found an existing account for server %s, email: %s!\n", server.c_str(), email.c_str())); + pExistingServiceAccount = pServiceAccount; + break; + } + } + } + + if (!pExistingServiceAccount) + { + UT_DEBUGMSG(("No existing account exists for server %s, email: %s\n", server.c_str(), email.c_str())); + + std::string password; + if (!ServiceAccountHandler::askPassword(email, password)) + return NULL; + + // create the new account + pExistingServiceAccount = static_cast(ServiceAccountHandlerConstructor()); + pExistingServiceAccount->addProperty("email", email); + pExistingServiceAccount->addProperty("password", password); + pExistingServiceAccount->addProperty("uri", server); + pExistingServiceAccount->addProperty("autoconnect", "true"); + bool success = pManager->addAccount(pExistingServiceAccount); + if (success) + pManager->storeProfile(); + } + + if (!pExistingServiceAccount->isOnline()) + pExistingServiceAccount->connect(); + + return pExistingServiceAccount; +} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabImport.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabImport.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabImport.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabImport.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,53 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __ABICOLLAB_IMPORT__ +#define __ABICOLLAB_IMPORT__ + +#include "ie_imp.h" +#include "ut_types.h" + +class IE_Imp_AbiCollabSniffer : public IE_ImpSniffer +{ +public: + IE_Imp_AbiCollabSniffer(); + virtual ~IE_Imp_AbiCollabSniffer(); + + virtual const IE_SuffixConfidence * getSuffixConfidence (); + virtual UT_Confidence_t recognizeContents(const char * szBuf, UT_uint32 iNumbytes); + virtual const IE_MimeConfidence * getMimeConfidence () { return NULL; } + virtual bool getDlgLabels (const char ** pszDesc, const char ** pszSuffixList, IEFileType * ft); + virtual UT_Error constructImporter (PD_Document * pDocument, IE_Imp ** ppie); +}; + +class IE_Imp_AbiCollab : public IE_Imp +{ +public: + IE_Imp_AbiCollab(PD_Document* pDocument); + +protected: + virtual UT_Error _loadFile(GsfInput * input); + +private: + UT_Error _openDocument(GsfInput * input, ServiceAccountHandler* pAccount, + const std::string& email, const std::string& server, UT_sint64 doc_id, UT_sint64 revision); + bool _parse(GsfInput * input, std::string& email, std::string& server, UT_sint64& doc_id, UT_sint64& revision); + ServiceAccountHandler* _getAccount(const std::string& email, const std::string& server); +}; + +#endif /* __ABICOLLAB_IMPORT__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabSaveInterceptor.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabSaveInterceptor.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabSaveInterceptor.cpp 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabSaveInterceptor.cpp 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,192 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include +#include "xap_App.h" +#include "ev_Menu_Actions.h" +#include "ap_Menu_Id.h" +#include "ap_Menu_Functions.h" +#include "ev_Toolbar_Actions.h" +#include "ap_Toolbar_Id.h" +#include "ap_Toolbar_Functions.h" +#include "ap_LoadBindings.h" +#include "ev_EditEventMapper.h" +#include "xap_Dlg_MessageBox.h" +#include "fv_View.h" +#include "xap_Frame.h" +#include "ut_debugmsg.h" +#include "AsyncWorker.h" +#include "ServiceAccountHandler.h" +#include +#include +#include "AbiCollabSaveInterceptor.h" + +#define SAVE_INTERCEPTOR_EM "com.abisource.abiword.abicollab.servicesaveinterceptor" + +static bool AbiCollabSaveInterceptor_interceptor(AV_View * v, EV_EditMethodCallData * d) +{ + return ServiceAccountHandler::m_saveInterceptor.intercept(v, d); +} + +#define DO_NOT_USE "" + +static ap_bs_Char CharTable[] = +{ +// {char, /* desc */ { none, _C, _A, _A_C }}, + {0x53, /* S */ { "insertData", "fileSaveAs", DO_NOT_USE, "" }}, + {0x73, /* s */ { "insertData", SAVE_INTERCEPTOR_EM, DO_NOT_USE, "" }}, +}; + +AbiCollabSaveInterceptor::AbiCollabSaveInterceptor() + : m_pOldSaveEM(NULL) +{ + UT_DEBUGMSG(("Installing Save menu interceptor!\n")); + EV_EditMethodContainer *pEMC = XAP_App::getApp()->getEditMethodContainer(); + + // store the old/normale editmethod to fall back when a document is not under service control + m_pOldSaveEM = pEMC->findEditMethodByName("fileSave"); + UT_return_if_fail(m_pOldSaveEM); + // install the edit method we will use to save to the webapp + EV_EditMethod* mySaveInterceptor = new EV_EditMethod ( + SAVE_INTERCEPTOR_EM, + &AbiCollabSaveInterceptor_interceptor, + 0, "AbiCollab Service Save Interceptor" + ); + pEMC->addEditMethod(mySaveInterceptor); + + // install the new menu action with our custom save edit method + XAP_App::getApp()->getMenuActionSet()->setAction( + AP_MENU_ID_FILE_SAVE, + false, /* holds submenu */ + false, /* raises dialog */ + false, /* is checkable */ + false, /* is radio */ + SAVE_INTERCEPTOR_EM, + ap_GetState_Changes, + NULL, /* state label */ + NULL + ); + + // install the new toolbar action with our custom save edit method + XAP_App::getApp()->getToolbarActionSet()->setAction( + AP_TOOLBAR_ID_FILE_SAVE, + EV_TBIT_PushButton, + SAVE_INTERCEPTOR_EM, + AV_CHG_ALL, + ap_ToolbarGetState_Changes + ); + + // install the new CTRL-s hook + // TODO: what to the with Save As? + const char * szCurrMode = XAP_App::getApp()->getInputMode(); + EV_EditBindingMap* pEbMap = XAP_App::getApp()->getBindingMap(szCurrMode); + UT_return_if_fail(pEbMap); + + AP_BindingSet* pBindingSet = static_cast(XAP_App::getApp()->getBindingSet()); + UT_return_if_fail(pBindingSet); + + pBindingSet->_loadChar(pEbMap, CharTable, 2, NULL, 0); +} + +bool AbiCollabSaveInterceptor::intercept(AV_View * v, EV_EditMethodCallData * d) +{ + UT_DEBUGMSG(("AbiCollabSaveInterceptor_intercept\n")); + UT_return_val_if_fail(v, false); + FV_View* pView = static_cast(v); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_val_if_fail(pManager, false); + + PD_Document* pDoc = pView->getDocument(); + UT_return_val_if_fail(pDoc, false); + + if (!pManager->isInSession(pDoc)) + return m_pOldSaveEM->Fn(v, d); + + UT_DEBUGMSG(("Document is in a collaboration session!\n")); + AbiCollab* pSession = pManager->getSession(pDoc); + UT_return_val_if_fail(pSession, m_pOldSaveEM->Fn(v, d)); + + // the session id should be unique on a specific account handler; let's + // just look it up amonst all our account handlers (not too efficient or + // elegant, but it works) + for (UT_uint32 i = 0; i < pManager->getAccounts().getItemCount(); i++) + { + AccountHandler* pHandler = pManager->getAccounts().getNthItem(i); + UT_continue_if_fail(pHandler); + if (pHandler->hasSession(pSession->getSessionId()) && + pHandler->getStorageType() == SERVICE_ACCOUNT_HANDLER_TYPE) + { + ServiceAccountHandler* pServiceHandler = static_cast(pHandler); + UT_DEBUGMSG(("Found the abicollab webservice account handler that controls this session!\n")); + + pManager->beginAsyncOperation(pSession); + // FIXME: guarantee save order! + boost::shared_ptr > async_save_ptr( + new AsyncWorker( + boost::bind(&ServiceAccountHandler::saveDocument, pServiceHandler, pDoc, pSession->getSessionId()), + boost::bind(&AbiCollabSaveInterceptor::_save_cb, this, _1, pSession) + ) + ); + async_save_ptr->start(); + + // make the document clean (even if it isn't _yet_) + pSession->getDocument()->setClean(); + pSession->getDocument()->signalListeners(PD_SIGNAL_DOCNAME_CHANGED); + pSession->getDocument()->signalListeners(PD_SIGNAL_DOCSAVED); + + XAP_Frame * pFrame = static_cast (pView->getParentData()); + if (pFrame->getViewNumber() > 0) + XAP_App::getApp()->updateClones(pFrame); + return true; + } + } + + UT_DEBUGMSG(("This session does not use the abicollab webservice; saving the old fashioned way...\n")); + return m_pOldSaveEM->Fn(v, d); +} + +void AbiCollabSaveInterceptor::_save_cb(UT_Error error, AbiCollab* pSession) +{ + UT_DEBUGMSG(("AbiCollabSaveInterceptor::_save_cb()\n")); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + + pManager->endAsyncOperation(pSession); + + // WARNING: do NOT assume we have a valid view or frame here: it could already + // have been deleted if the frame was closed (or abiword shutdown) before this + // callback came back. + // You can safely use the AbiCollab pointer or PD_Document pointer though, as + // the AbiCollabSessionManager makes sure those are still valid. + + if (error != UT_OK) + { + // idealy we would use the same frame that was used to save the document, + // but we don't know if that one is still valid + if (XAP_App::getApp()->getLastFocussedFrame()) + { + // TODO: add the document name, error type and perhaps the server name + // TODO: offer some kind of solution to the user + UT_UTF8String msg("An error occured while saving this document to the web-service!"); + XAP_App::getApp()->getLastFocussedFrame()->showMessageBox(msg.utf8_str(), XAP_Dialog_MessageBox::b_O, XAP_Dialog_MessageBox::a_OK); + } + } + return; +} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabSaveInterceptor.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabSaveInterceptor.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabSaveInterceptor.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabSaveInterceptor.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,41 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __ABICOLLAB_SAVE_INTERCEPTOR__ +#define __ABICOLLAB_SAVE_INTERCEPTOR__ + +#include "ev_EditMethod.h" + +class AV_View; +class EV_EditMethodCallData; +class EV_EditMethod; + +class AbiCollabSaveInterceptor +{ +public: + AbiCollabSaveInterceptor(); + + bool intercept(AV_View * v, EV_EditMethodCallData * d); + +private: + void _save_cb(UT_Error error, AbiCollab* pSession); + + EV_EditMethod* m_pOldSaveEM; +}; + +#endif /* __ABICOLLAB_SAVE_INTERCEPTOR__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabService_Export.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabService_Export.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabService_Export.h 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AbiCollabService_Export.h 2008-07-13 13:05:17.000000000 +0100 @@ -36,7 +36,7 @@ class PX_ChangeRecord; class ChangeAdjust; -class ABI_EXPORT AbiCollabService_Export : public PL_DocChangeListener +class AbiCollabService_Export : public PL_DocChangeListener { public: AbiCollabService_Export(PD_Document* pDoc, UT_sint64 iID); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/abicollab_types.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/abicollab_types.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/abicollab_types.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/abicollab_types.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,113 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __ABICOLLAB_TYPES__ +#define __ABICOLLAB_TYPES__ + +#include +#include "soa.h" + +namespace abicollab { + +class File { +public: + static boost::shared_ptr construct(soa::GenericPtr value) { + if (soa::CollectionPtr coll = value->as()) { + boost::shared_ptr file(new File()); + if (soa::StringPtr doc_id_ = coll->get("doc_id")) + file->doc_id = doc_id_->value(); + if (soa::StringPtr filename_ = coll->get("filename")) + file->filename = filename_->value(); + if (soa::StringPtr tags_ = coll->get("tags")) + file->tags = tags_->value(); + if (soa::StringPtr filesize_ = coll->get("filesize")) + file->filesize = filesize_->value(); + if (soa::StringPtr lastchanged_ = coll->get("lastchanged")) + file->lastchanged = lastchanged_->value(); + if (soa::IntPtr lastrevision_ = coll->get("lastrevision")) + file->lastrevision = lastrevision_->value(); + if (soa::StringPtr access_ = coll->get("access")) + file->access = access_->value(); + return file; + } + return boost::shared_ptr(); + } + + std::string doc_id; + std::string filename; + std::string tags; + std::string filesize; + std::string lastchanged; + int64_t lastrevision; + std::string access; +}; +typedef boost::shared_ptr FilePtr; +typedef boost::shared_ptr< soa::Array< abicollab::FilePtr > > FileArrayPtr; + +class Friend : public soa::Collection { +public: + Friend(const std::string& name) + : soa::Collection(name) + {} + + static boost::shared_ptr construct(soa::GenericPtr value) { + if (soa::CollectionPtr coll = value->as()) { + boost::shared_ptr friend_(new Friend(coll->name())); + if (soa::StringPtr name_ = coll->get("name")) + friend_->name = name_->value(); + if (soa::StringPtr email_ = coll->get("email")) + friend_->email = email_->value(); + friend_->files = coll->get< soa::Array >("files"); + return friend_; + } + return boost::shared_ptr(); + } + + std::string name; + std::string email; + soa::ArrayPtr files; +}; +typedef boost::shared_ptr FriendPtr; +typedef boost::shared_ptr< soa::Array< FriendPtr > > FriendArrayPtr; + +class Group : public soa::Collection { +public: + Group(const std::string& name) + : soa::Collection(name) + {} + + static boost::shared_ptr construct(soa::GenericPtr value) { + if (soa::CollectionPtr coll = value->as()) { + boost::shared_ptr group_(new Group(coll->name())); + if (soa::StringPtr name_ = coll->get("name")) + group_->name = name_->value(); + group_->files = coll->get< soa::Array >("files"); + return group_; + } + return boost::shared_ptr(); + } + + std::string name; + soa::ArrayPtr files; +}; +typedef boost::shared_ptr GroupPtr; +typedef boost::shared_ptr< soa::Array< GroupPtr > > GroupArrayPtr; + +} + +#endif /* __ABICOLLAB_TYPES__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericInput.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericInput.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericInput.cpp 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericInput.cpp 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,33 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include "xap_App.h" +#include "xap_Dialog_Id.h" +#include "xap_DialogFactory.h" + +#include "ap_Dialog_GenericInput.h" + +AP_Dialog_GenericInput::AP_Dialog_GenericInput(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id) + : XAP_Dialog_NonPersistent(pDlgFactory, id, "interface/dialogcollaborationinput"), + m_bIsPassword(false) +{ +} + +AP_Dialog_GenericInput::~AP_Dialog_GenericInput(void) +{ +} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericInput.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericInput.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericInput.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericInput.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,82 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef AP_DIALOG_GENERICINPUT_H +#define AP_DIALOG_GENERICINPUT_H + +#include "ut_types.h" +#include "xap_Dialog.h" + +extern pt2Constructor ap_Dialog_GenericInput_Constructor; + +class AP_Dialog_GenericInput : public XAP_Dialog_NonPersistent +{ +public: + AP_Dialog_GenericInput(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); + virtual ~AP_Dialog_GenericInput(void); + + virtual void runModal(XAP_Frame * pFrame) = 0; + + // functions related to password style input + bool isPassword() + { return m_bIsPassword; } + void setPassword(bool bIsPassword) + { m_bIsPassword = bIsPassword; } + + // messages to display + void setTitle(const UT_UTF8String& sTitle) + { m_sTitle = sTitle; } + + const UT_UTF8String& getTitle() + { return m_sTitle; } + + void setQuestion(const UT_UTF8String& sQuestion) + { m_sQuestion = sQuestion; } + + const UT_UTF8String& getQuestion() + { return m_sQuestion; } + + void setLabel(const UT_UTF8String& sLabel) + { m_sLabel = sLabel; } + + const UT_UTF8String& getLabel() + { return m_sLabel; } + + typedef enum { a_OK, a_CANCEL } tAnswer; + + AP_Dialog_GenericInput::tAnswer getAnswer(void) const + { return m_answer; } + + const UT_UTF8String& getInput() const + { return m_input; } + +protected: + void _setInput(const UT_UTF8String& input) + { m_input = input; } + + AP_Dialog_GenericInput::tAnswer m_answer; + +private: + UT_UTF8String m_sTitle; + UT_UTF8String m_sQuestion; + UT_UTF8String m_sLabel; + bool m_bIsPassword; + UT_UTF8String m_input; +}; + +#endif /* AP_DIALOG_GENERICINPUT_H */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericProgress.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericProgress.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericProgress.cpp 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericProgress.cpp 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,32 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include "xap_App.h" +#include "xap_Dialog_Id.h" +#include "xap_DialogFactory.h" + +#include "ap_Dialog_GenericProgress.h" + +AP_Dialog_GenericProgress::AP_Dialog_GenericProgress(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id) + : XAP_Dialog_NonPersistent(pDlgFactory, id, "interface/dialogcollaborationprogress") +{ +} + +AP_Dialog_GenericProgress::~AP_Dialog_GenericProgress(void) +{ +} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericProgress.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericProgress.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericProgress.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ap_Dialog_GenericProgress.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,63 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef AP_DIALOG_GENERICPROGRESS_H +#define AP_DIALOG_GENERICPROGRESS_H + +#include "ut_types.h" +#include "xap_Dialog.h" + +extern pt2Constructor ap_Dialog_GenericProgress_Constructor; + +class AP_Dialog_GenericProgress : public XAP_Dialog_NonPersistent +{ +public: + AP_Dialog_GenericProgress(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id); + virtual ~AP_Dialog_GenericProgress(void); + + virtual void runModal(XAP_Frame * pFrame) = 0; + + void setTitle(const UT_UTF8String& sTitle) + { m_sTitle = sTitle; } + + const UT_UTF8String& getTitle() + { return m_sTitle; } + + void setInformation(const UT_UTF8String& sInformation) + { m_sInformation = sInformation; } + + const UT_UTF8String& getInformation() + { return m_sInformation; } + + virtual void close() = 0; + virtual void setProgress(UT_uint32 progress) = 0; + + typedef enum { a_OK, a_CANCEL } tAnswer; + + AP_Dialog_GenericProgress::tAnswer getAnswer(void) const + { return m_answer; } + +protected: + AP_Dialog_GenericProgress::tAnswer m_answer; + +private: + UT_UTF8String m_sTitle; + UT_UTF8String m_sInformation; +}; + +#endif /* AP_DIALOG_GENERICPROGRESS_H */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AsioRealmProtocol.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AsioRealmProtocol.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AsioRealmProtocol.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AsioRealmProtocol.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,59 @@ +#ifndef __ASIO_REALM_PROTOCOL__ +#define __ASIO_REALM_PROTOCOL__ + +#include "RealmProtocol.h" + +namespace realm { + +namespace protocolv1 { + + template + static void send(const RoutingPacket& p, asio::ip::tcp::socket& socket, WriteHandler handler) { + std::vector bufs(4); + bufs.push_back(asio::buffer(&p.type(), 1)); + bufs.push_back(asio::buffer(&p.getPayloadSize(), 4)); // FIXME: not Big Endian safe! + bufs.push_back(asio::buffer(&p.getAddressCount(), 1)); + bufs.push_back(asio::buffer(&(p.getConnectionIds()[0]), p.getConnectionIds().size())); + bufs.push_back(asio::buffer(*p.getMessage())); + asio::async_write(socket, bufs, handler); + } + + template + static void send(const DeliverPacket& p, asio::ip::tcp::socket& socket, WriteHandler handler) { + std::vector bufs(4); + bufs.push_back(asio::buffer(&p.type(), 1)); + bufs.push_back(asio::buffer(&p.getPayloadSize(), 4)); // FIXME: not Big Endian safe! + bufs.push_back(asio::buffer(&p.getConnectionId(), 1)); + bufs.push_back(asio::buffer(*p.getMessage())); + asio::async_write(socket, bufs, handler); + } + + template + static void send(const UserJoinedPacket& p, asio::ip::tcp::socket& socket, WriteHandler handler) { + std::vector bufs(4); + bufs.push_back(asio::buffer(&p.type(), 1)); + bufs.push_back(asio::buffer(&p.getPayloadSize(), 4)); // FIXME: not Big Endian safe! + bufs.push_back(asio::buffer(&p.getConnectionId(), 1)); + bufs.push_back(asio::buffer(&p.isMaster(), 1)); + bufs.push_back(asio::buffer(*p.getUserInfo())); + asio::async_write(socket, bufs, handler); + } + + template + static void send(const UserLeftPacket& p, asio::ip::tcp::socket& socket, WriteHandler handler) { + std::vector bufs(2); + bufs.push_back(asio::buffer(&p.type(), 1)); + bufs.push_back(asio::buffer(&p.getConnectionId(), 1)); + asio::async_write(socket, bufs, handler); + } + + template + static void send(const SessionTakeOverPacket& p, asio::ip::tcp::socket& socket, WriteHandler handler) { + asio::async_write(socket, asio::buffer(&p.type(), 1), handler); + } + +} + +} + +#endif /* ASIO_REALM_PROTOCOL__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AsyncWorker.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AsyncWorker.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/AsyncWorker.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/AsyncWorker.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,83 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __ASYNC_WORKER__ +#define __ASYNC_WORKER__ + +#include +#include +#include +#include +#include +#include "ut_debugmsg.h" +#include + +template +class AsyncWorker : private boost::noncopyable, public boost::enable_shared_from_this > +{ +public: + AsyncWorker(boost::function async_func, boost::function async_callback) + : m_async_func(async_func), + m_async_callback(async_callback), + m_synchronizer() // can't initialize the synchronizer here yet, because you can't call shared_from_this() from a constructor + { + } + + virtual ~AsyncWorker() + { + UT_DEBUGMSG(("~AsyncWorker()\n")); + if (m_thread_ptr) + m_thread_ptr->join(); + } + + virtual void start() + { + m_synchronizer.reset(new Synchronizer(boost::bind(&AsyncWorker::_signal, + boost::enable_shared_from_this >::shared_from_this()))); + m_thread_ptr.reset( + new asio::thread( + boost::bind(&AsyncWorker::_thread_func, + AsyncWorker::shared_from_this()) + ) + ); + } + +private: + void _signal() + { + UT_DEBUGMSG(("Calling async callback function from the main loop\n")); + m_async_callback(m_func_result); + m_synchronizer.reset(); + } + + void _thread_func() + { + UT_DEBUGMSG(("Starting async function...\n")); + m_func_result = m_async_func(); + UT_DEBUGMSG(("Async function completed...\n")); + m_synchronizer->signal(); + } + + boost::function m_async_func; + boost::function m_async_callback; + boost::shared_ptr m_synchronizer; + boost::shared_ptr m_thread_ptr; + T m_func_result; +}; + +#endif /* __ASYNC_WORKER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/GNUmakefile.am /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/GNUmakefile.am --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/GNUmakefile.am 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/GNUmakefile.am 2008-07-13 13:05:17.000000000 +0100 @@ -11,11 +11,34 @@ noinst_LTLIBRARIES = libAbiCollabServiceHandler.la libAbiCollabServiceHandler_la_SOURCES = \ + AbiCollabSaveInterceptor.cpp \ + AbiCollabSaveInterceptor.h \ + ap_Dialog_GenericInput.cpp \ + ap_Dialog_GenericInput.h \ + ap_Dialog_GenericProgress.cpp \ + ap_Dialog_GenericProgress.h \ ServiceAccountHandler.cpp \ ServiceAccountHandler.h \ + ServiceBuddy.h \ + AbiCollabImport.h \ + AbiCollabImport.cpp \ AbiCollabService_Export.cpp \ - AbiCollabService_Export.h - + AbiCollabService_Export.h \ + AsioRealmProtocol.h \ + AsyncWorker.h \ + InterruptableAsyncWorker.h \ + ProgressiveSoapCall.h \ + RealmBuddy.h \ + RealmConnection.h \ + RealmConnection.cpp \ + RealmGrowBuffer.h \ + RealmProtocol.cpp \ + ServiceErrorCodes.h \ + soa.h \ + soa_result.h \ + soa_soup.h \ + soa_types.h \ + abicollab_types.h libAbiCollabServiceHandler_la_LIBADD = ../unix/libAbiCollabServiceUnixHandler.la @ABI_LIBS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/GNUmakefile.in 2008-04-06 22:37:36.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/GNUmakefile.in 2008-07-13 14:09:56.000000000 +0100 @@ -50,8 +50,11 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libAbiCollabServiceHandler_la_DEPENDENCIES = \ ../unix/libAbiCollabServiceUnixHandler.la -am_libAbiCollabServiceHandler_la_OBJECTS = ServiceAccountHandler.lo \ - AbiCollabService_Export.lo +am_libAbiCollabServiceHandler_la_OBJECTS = \ + AbiCollabSaveInterceptor.lo ap_Dialog_GenericInput.lo \ + ap_Dialog_GenericProgress.lo ServiceAccountHandler.lo \ + AbiCollabImport.lo AbiCollabService_Export.lo \ + RealmConnection.lo RealmProtocol.lo libAbiCollabServiceHandler_la_OBJECTS = \ $(am_libAbiCollabServiceHandler_la_OBJECTS) libAbiCollabServiceHandler_la_LINK = $(LIBTOOL) --tag=CXX \ @@ -90,6 +93,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ @@ -325,10 +330,34 @@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libAbiCollabServiceHandler.la libAbiCollabServiceHandler_la_SOURCES = \ + AbiCollabSaveInterceptor.cpp \ + AbiCollabSaveInterceptor.h \ + ap_Dialog_GenericInput.cpp \ + ap_Dialog_GenericInput.h \ + ap_Dialog_GenericProgress.cpp \ + ap_Dialog_GenericProgress.h \ ServiceAccountHandler.cpp \ ServiceAccountHandler.h \ + ServiceBuddy.h \ + AbiCollabImport.h \ + AbiCollabImport.cpp \ AbiCollabService_Export.cpp \ - AbiCollabService_Export.h + AbiCollabService_Export.h \ + AsioRealmProtocol.h \ + AsyncWorker.h \ + InterruptableAsyncWorker.h \ + ProgressiveSoapCall.h \ + RealmBuddy.h \ + RealmConnection.h \ + RealmConnection.cpp \ + RealmGrowBuffer.h \ + RealmProtocol.cpp \ + ServiceErrorCodes.h \ + soa.h \ + soa_result.h \ + soa_soup.h \ + soa_types.h \ + abicollab_types.h libAbiCollabServiceHandler_la_LIBADD = ../unix/libAbiCollabServiceUnixHandler.la @ABI_LIBS@ libAbiCollabServiceHandler_la_LDFLAGS = -no-undefined -module -avoid-version @@ -383,8 +412,14 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AbiCollabImport.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AbiCollabSaveInterceptor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AbiCollabService_Export.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RealmConnection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RealmProtocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ServiceAccountHandler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ap_Dialog_GenericInput.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ap_Dialog_GenericProgress.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/InterruptableAsyncWorker.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/InterruptableAsyncWorker.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/InterruptableAsyncWorker.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/InterruptableAsyncWorker.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,152 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __INTERRUPTABLE_ASYNC_WORKER__ +#define __INTERRUPTABLE_ASYNC_WORKER__ + +#include +#include +#include "xap_App.h" +#include "xap_DialogFactory.h" +#include "AsyncWorker.h" +#include "ap_Dialog_GenericProgress.h" +#include "ServiceAccountHandler.h" + +class InterruptedException {}; +class InternalErrorException {}; + +template +class InterruptableAsyncWorker : public boost::enable_shared_from_this< InterruptableAsyncWorker > +{ +public: + InterruptableAsyncWorker(boost::function async_func) + : m_async_func(async_func), + m_worker_ptr(), + m_pProgressDlg(NULL), + m_progress(0), + m_cancelled(false), + m_finished(false), + m_progressSynchronizerPtr(), + m_result() + {} + + T run() + { + UT_DEBUGMSG(("InterruptableAsyncWorker::run()\n")); + + m_worker_ptr.reset(new AsyncWorker(m_async_func, boost::bind(&InterruptableAsyncWorker::invoke_cb, InterruptableAsyncWorker::shared_from_this(), _1))); + m_progressSynchronizerPtr.reset(new Synchronizer(boost::bind(&InterruptableAsyncWorker::_updateDialog, InterruptableAsyncWorker::shared_from_this()))); + + // get the progress dialog + XAP_Frame* pFrame = XAP_App::getApp()->getLastFocussedFrame(); + if (!pFrame) + throw InternalErrorException(); + + XAP_DialogFactory* pFactory = static_cast(XAP_App::getApp()->getDialogFactory()); + if (!pFactory) + throw InternalErrorException(); + + m_pProgressDlg = static_cast( + pFactory->requestDialog(ServiceAccountHandler::getDialogGenericProgressId()) + ); + m_pProgressDlg->setTitle("Retrieving Document"); + m_pProgressDlg->setInformation("Please wait while retrieving document..."); + + // start the asynchronous process + m_worker_ptr->start(); + + // run the dialog + m_pProgressDlg->runModal(pFrame); + UT_DEBUGMSG(("Progress dialog destroyed...\n")); + m_cancelled = m_pProgressDlg->getAnswer() == AP_Dialog_GenericProgress::a_CANCEL; + pFactory->releaseDialog(m_pProgressDlg); + m_pProgressDlg = NULL; + if (m_cancelled) + throw InterruptedException(); + return m_result; + } + + bool cancelled() + { + return m_cancelled; + } + + void progress(uint32_t progress) + { + UT_DEBUGMSG(("InterruptableAsyncWorker::_progress_cb() - %d\n", progress)); + UT_return_if_fail(m_progressSynchronizerPtr); + + if (progress > 100) + progress = 100; + + m_progress = progress; + m_progressSynchronizerPtr->signal(); + } + + // the result of run() is undefined when using this function + void forceFinished() + { + m_finished = true; + m_progressSynchronizerPtr->signal(); + } + +private: + void invoke_cb(T result) + { + UT_DEBUGMSG(("InterruptableAsyncWorker::invoke_cb()\n")); + m_result = result; + + // signal the mainloop that we are done + m_finished = true; + m_progressSynchronizerPtr->signal(); + } + + void _updateDialog() + { + UT_DEBUGMSG(("InterruptableAsyncWorker::_updateDialog()\n")); + if (m_finished) + { + UT_DEBUGMSG(("We are finished, closing dialog...\n")); + if (m_pProgressDlg) + m_pProgressDlg->close(); + else + UT_DEBUGMSG(("Skipping dialog closure; it is destructed already\n")); + } + else + { + UT_DEBUGMSG(("Setting progress value to %d%%\n", m_progress)); + if (m_pProgressDlg) // it could be that we have no dialog when we have been cancelled + m_pProgressDlg->setProgress(m_progress); + else + UT_DEBUGMSG(("Skipping dialog progress update; it is destructed already\n")); + } + } + + boost::function m_async_func; + boost::shared_ptr< AsyncWorker > m_worker_ptr; + + AP_Dialog_GenericProgress* m_pProgressDlg; + uint32_t m_progress; + bool m_cancelled; + bool m_finished; + boost::shared_ptr m_progressSynchronizerPtr; + + T m_result; +}; + +#endif /* __INTERRUPTABLE_ASYNC_WORKER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ProgressiveSoapCall.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ProgressiveSoapCall.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ProgressiveSoapCall.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ProgressiveSoapCall.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,107 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __PROGRESSIVE_SOAP_CALL__ +#define __PROGRESSIVE_SOAP_CALL__ + +#include +#include +#include "InterruptableAsyncWorker.h" +#include "soa_soup.h" + +class ProgressiveSoapCall : public boost::enable_shared_from_this +{ +public: + ProgressiveSoapCall(const std::string& uri, soa::function_call& fc, const std::string& ssl_ca_file) + : m_uri(uri), + m_fc(fc), + m_ssl_ca_file(ssl_ca_file), + m_worker_ptr(), + m_soapFault() + {} + + soa::GenericPtr run() + { + UT_DEBUGMSG(("ProgressiveSoapCall::run()\n")); + + m_worker_ptr.reset(new InterruptableAsyncWorker( + boost::bind(&ProgressiveSoapCall::invoke, shared_from_this()) + )); + + // start the asynchronous process and display the dialog + try + { + soa::GenericPtr res = m_worker_ptr->run(); + if (m_soapFault) + throw *m_soapFault; + return res; + } + catch (InterruptedException e) + { + UT_DEBUGMSG(("Soap call interrupted!\n")); + return soa::GenericPtr(); + } + } + +private: + soa::GenericPtr invoke() + { + UT_DEBUGMSG(("ProgressiveSoapCall::invoke()\n")); + try { + return soup_soa::invoke( + m_uri, soa::method_invocation("urn:AbiCollabSOAP", m_fc), m_ssl_ca_file, + boost::bind(&ProgressiveSoapCall::_progress_cb, this, _1, _2, _3) + ); + } catch (soa::SoapFault& fault) { + m_soapFault.reset(new soa::SoapFault(fault)); + return soa::GenericPtr(); + } + } + + void _progress_cb(SoupSession* session, SoupMessage* msg, uint32_t progress) + { + UT_DEBUGMSG(("ProgressiveSoapCall::_progress_cb()\n")); + UT_return_if_fail(session && msg); + UT_return_if_fail(m_worker_ptr); + + if (m_worker_ptr->cancelled()) + { +#ifdef SOUP24 + soup_session_cancel_message(session, msg, SOUP_STATUS_CANCELLED); +#else + soup_message_set_status(msg, SOUP_STATUS_CANCELLED); + soup_session_cancel_message(session, msg); +#endif + return; + } + + m_worker_ptr->progress(progress); + } + + std::string m_uri; + soa::function_call& m_fc; + std::string m_ssl_ca_file; + + boost::shared_ptr< InterruptableAsyncWorker > + m_worker_ptr; + + boost::shared_ptr m_soapFault; + soa::GenericPtr m_result; +}; + +#endif /* __PROGRESSIVE_SOAP_CALL__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmBuddy.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmBuddy.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmBuddy.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmBuddy.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,83 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __REALM_BUDDY__ +#define __REALM_BUDDY__ + +#include +#include +#include +#include "ut_string_class.h" +#include +#include + +class RealmConnection; + +class RealmBuddy : public Buddy , public boost::enable_shared_from_this +{ +public: + RealmBuddy(AccountHandler* handler, UT_uint8 realm_connection_id, bool master, RealmConnection& connection) + : Buddy(handler, boost::lexical_cast(realm_connection_id).c_str()), + m_realm_connection_id(realm_connection_id), + m_master(master), + m_connection(connection) + { + setVolatile(true); + } + + virtual Buddy* clone() const { return new RealmBuddy( *this ); } + + virtual UT_UTF8String getDescription() const + { + return getName(); + } + + virtual const DocTreeItem* getDocTreeItems() const + { + return NULL; + } + + boost::shared_ptr ptr() { + return shared_from_this(); + } + + boost::shared_ptr ptr() const { + return shared_from_this(); + } + + RealmConnection& connection() const { + return m_connection; + } + + UT_uint8 realm_connection_id() const { + return m_realm_connection_id; + } + + bool master() const { + return m_master; + } + +private: + UT_uint8 m_realm_connection_id; + bool m_master; + RealmConnection& m_connection; +}; + +typedef boost::shared_ptr RealmBuddyPtr; + +#endif /* __REALM_BUDDY__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmConnection.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmConnection.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmConnection.cpp 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmConnection.cpp 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,308 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include +#include +#include +#include "ut_assert.h" +#include "ut_debugmsg.h" +#include "RealmConnection.h" + +namespace rpv1 = realm::protocolv1; + +RealmConnection::RealmConnection(const std::string& ca_file, const std::string& address, int port, + const std::string& cookie, UT_sint64 doc_id, bool master, const std::string& session_id, + boost::function sig) + : m_io_service(), + m_socket(m_io_service), + m_ca_file(ca_file), + m_address(address), + m_port(port), + m_thread_ptr(), + m_cookie(cookie), + m_doc_id(doc_id), + m_master(master), + m_session_id(session_id), + m_buf(1024), // always have a reasonable block of free memory available to cut back on the memory allocations a bit, + m_packet_queue(boost::bind(&RealmConnection::_signal, this)), // TODO: shouldn't this be a shared pointer? Can't we handle signals in this way while this object has been already deleted? - MARCM + m_sig(sig), + m_buddies(), + m_pdp_ptr(), + m_tls_tunnel_ptr() +{ +} + +bool RealmConnection::connect() +{ + UT_DEBUGMSG(("RealmConnection::connect()\n")); + UT_return_val_if_fail(!m_thread_ptr, false); + + try { + // setup our local TLS tunnel to the realm + m_tls_tunnel_ptr.reset(new tls_tunnel::ClientProxy(m_address, m_port, m_ca_file, false)); + asio::thread thread(boost::bind(&tls_tunnel::ClientProxy::run, m_tls_tunnel_ptr)); + + // connect to the tunnel + asio::ip::tcp::resolver::query query(m_tls_tunnel_ptr->local_address(), boost::lexical_cast(m_tls_tunnel_ptr->local_port())); + asio::ip::tcp::resolver resolver(m_io_service); + asio::ip::tcp::resolver::iterator iterator(resolver.resolve(query)); + m_socket.connect(*iterator); + } + catch (tls_tunnel::Exception& e) + { + UT_DEBUGMSG(("tls_tunnel exception connecting to realm: %s\n", e.message().c_str())); + return false; + } + catch (asio::system_error& se) + { + UT_DEBUGMSG(("Error connecting to realm: %s\n", se.what())); + return false; + } + catch (...) + { + UT_DEBUGMSG(("Error connecting to realm!\n")); + return false; + } + + if (!_login()) + { + UT_DEBUGMSG(("RealmConnection login failed!\n")); + _disconnect(); + return false; + } + + UT_DEBUGMSG(("RealmConnection connected\n")); + + // start reading realm messages + _receive(); + + m_thread_ptr.reset(new asio::thread(boost::bind(&asio::io_service::run, &m_io_service))); + return true; +} + +void RealmConnection::disconnect() +{ + UT_DEBUGMSG(("RealmConnection::disconnect()\n")); + if (m_socket.is_open()) + { + asio::error_code ac; + m_socket.shutdown(asio::ip::tcp::socket::shutdown_both, ac); + m_socket.close(ac); + } +} + +bool RealmConnection::isConnected() +{ + return m_socket.is_open(); +} + +void RealmConnection::addBuddy(RealmBuddyPtr buddy_ptr) +{ + m_buddies.push_back(buddy_ptr); +} + +void RealmConnection::removeBuddy(UT_uint8 realm_connection_id) +{ + for (std::vector >::iterator it = m_buddies.begin(); it != m_buddies.end(); it++) + { + UT_continue_if_fail(*it); + if ((*it)->realm_connection_id() == realm_connection_id) + { + m_buddies.erase(it); + return; + } + } + + UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); +} + +RealmBuddyPtr RealmConnection::getBuddy(UT_uint8 realm_connection_id) +{ + for (std::vector >::iterator it = m_buddies.begin(); it != m_buddies.end(); it++) + { + UT_continue_if_fail(*it); + if ((*it)->realm_connection_id() == realm_connection_id) + { + return *it; + } + } + return RealmBuddyPtr(); +} + +void RealmConnection::_disconnect() +{ + UT_DEBUGMSG(("RealmConnection::_disconnect()\n")); + + if (m_socket.is_open()) + { + asio::error_code ac; + m_socket.shutdown(asio::ip::tcp::socket::shutdown_both, ac); + m_socket.close(ac); + } + + if (m_thread_ptr) + { + m_io_service.stop(); + m_thread_ptr->join(); + m_thread_ptr.reset(); + } + + if (m_tls_tunnel_ptr) + { + m_tls_tunnel_ptr->stop(); + m_tls_tunnel_ptr.reset(); + } + + // signal the packet queue, so the listener will be informed of the + // disconnect; this is a bit wacky (design wise), but it works + m_packet_queue.signal(); +} + +void RealmConnection::_signal() +{ + m_sig(*this); +} + +bool RealmConnection::_login() +{ + UT_DEBUGMSG(("RealmConnection::_login()\n")); + + // FIXME: make this a combined asio buffer + boost::shared_ptr header_ptr(new std::string(2*sizeof(UT_uint32) + m_cookie.size(), '\0')); + std::string& header = *header_ptr; + + UT_uint32 proto_magic = 0x000A0B01; + UT_uint32 proto_version = 0x01; + // FIXME: not Big Endian safe!! + memcpy(&header[0], &proto_magic, sizeof(UT_uint32)); + memcpy(&header[sizeof(UT_uint32)], &proto_version, sizeof(UT_uint32)); + memcpy(&header[2*sizeof(UT_uint32)], m_cookie.data(), m_cookie.size()); + + // holds the login response information + std::string response(1, '\0'); + + try + { + // send the login credententials + // TODO: we should check the number of bytes written + asio::write(m_socket, asio::buffer(header)); + + // read the login response + // TODO: we should check the number of bytes read + asio::read(m_socket, asio::buffer(&response[0], response.size())); + } + catch (asio::system_error e) + { + UT_DEBUGMSG(("Error while writing/writing protocol header: %s\n", e.what())); + return false; + } + + switch (response[0]) + { + case realm::protocol::HANDSHAKE_RESERVED: + UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); + return false; + case realm::protocol::HANDSHAKE_OK: + UT_DEBUGMSG(("Login response OK!\n")); + break; + case realm::protocol::HANDSHAKE_BAD_IDENTIFIER: + UT_DEBUGMSG(("realm::protocol::HANDSHAKE_BAD_IDENTIFIER response!\n")); + return false; + case realm::protocol::HANDSHAKE_UNSUPPORTED_PROTOCOL: + UT_DEBUGMSG(("realm::protocol::HANDSHAKE_UNSUPPORTED_PROTOCOL response!\n")); + return false; + case realm::protocol::HANDSHAKE_INVALID_COOKIE: + UT_DEBUGMSG(("realm::protocol::HANDSHAKE_INVALID_COOKIE response!\n")); + return false; + default: + UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); + return false; + } + + return true; +} + +void RealmConnection::_receive() +{ + UT_DEBUGMSG(("RealmConnection::_receive()\n")); + m_buf.clear(); + boost::shared_ptr msg_ptr(new std::string(1, '\0')); + asio::async_read(m_socket, asio::buffer(&(*msg_ptr)[0], msg_ptr->size()), + boost::bind(&RealmConnection::_message, shared_from_this(), + asio::placeholders::error, asio::placeholders::bytes_transferred, msg_ptr)); +} + +void RealmConnection::_message(const asio::error_code& e, std::size_t bytes_transferred, boost::shared_ptr msg_ptr) +{ + UT_DEBUGMSG(("RealmConnection::_message()\n")); + if (e) + { + UT_DEBUGMSG(("Error reading message: %s\n", e.message().c_str())); + _disconnect(); + return; + } + UT_DEBUGMSG(("Constructing packet of type: 0x%x\n", (*msg_ptr)[0])); + PacketPtr packet_ptr = realm::protocolv1::Packet::construct(static_cast((*msg_ptr)[0])); + if (!packet_ptr) { + UT_DEBUGMSG(("Error constructing packet for type 0x%x\n", (*msg_ptr)[0])); + return; + } + _complete_packet(packet_ptr); +} + +void RealmConnection::_complete_packet(PacketPtr packet_ptr) +{ + UT_DEBUGMSG(("RealmConnection::_complete_packet()\n")); + int bytes_needed = packet_ptr->complete(m_buf.data(), m_buf.size()); + switch (bytes_needed) + { + case -1: + UT_DEBUGMSG(("Error determining packet (type: 0x%x) completion state!\n", packet_ptr->type())); + return; + case 0: + { + UT_DEBUGMSG(("Read full packet\n")); + UT_return_if_fail(packet_ptr->parse(m_buf.data(), m_buf.size()) != -1); + m_packet_queue.push(packet_ptr); + _receive(); + } + break; + default: + UT_DEBUGMSG(("Need more data (%d bytes) for this packet...\n", bytes_needed)); + // read the needed number of bytes + char* ptr = m_buf.prepare(bytes_needed); + asio::async_read(m_socket, asio::buffer(ptr, bytes_needed), + boost::bind(&RealmConnection::_complete, shared_from_this(), + asio::placeholders::error, asio::placeholders::bytes_transferred, packet_ptr) + ); + break; + } +} + +void RealmConnection::_complete(const asio::error_code& e, std::size_t bytes_transferred, PacketPtr packet_ptr) +{ + UT_DEBUGMSG(("RealmConnection::_complete()\n")); + if (e) + { + UT_DEBUGMSG(("Error reading message: %s\n", e.message().c_str())); + _disconnect(); + return; + } + m_buf.commit(bytes_transferred); + _complete_packet(packet_ptr); +} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmConnection.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmConnection.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmConnection.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmConnection.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,128 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __REALM_CONNECTION__ +#define __REALM_CONNECTION__ + +#include +#include +#include +#include +#include +#include "ut_types.h" +#include "RealmBuddy.h" +#include "RealmGrowBuffer.h" +#include "RealmProtocol.h" +#include +#include + +class AP_Dialog_GenericProgress; + +using realm::protocolv1::PacketPtr; + +struct PendingDocumentProperties +{ + PendingDocumentProperties(AP_Dialog_GenericProgress* pDlg_, + PD_Document** pDoc_, XAP_Frame* pFrame_, const std::string& filename_) + : pDlg(pDlg_), pDoc(pDoc_), pFrame(pFrame_), filename(filename_) + {} + + AP_Dialog_GenericProgress* pDlg; + PD_Document** pDoc; + XAP_Frame* pFrame; + std::string filename; +}; + +class RealmConnection : public boost::enable_shared_from_this +{ +public: + RealmConnection(const std::string& ca_file, const std::string& address, int port, + const std::string& cookie, UT_sint64 doc_id, bool master, const std::string& session_id, + boost::function sig); + + bool connect(); + void disconnect(); + bool isConnected(); + + void addBuddy(RealmBuddyPtr buddy_ptr); + void removeBuddy(UT_uint8 realm_connection_id); + RealmBuddyPtr getBuddy(UT_uint8 realm_connection_id); + std::vector& getBuddies() + { return m_buddies; } + + UT_sint64 doc_id() + { return m_doc_id; } + bool master() + { return m_master; } + const std::string& session_id() + { return m_session_id; } + SynchronizedQueue& queue() + { return m_packet_queue; } + asio::ip::tcp::socket& socket() + { return m_socket; } + + void loadDocumentStart(AP_Dialog_GenericProgress* pDlg, + PD_Document** pDoc_, XAP_Frame* pFrame_, const std::string& filename_) + { + UT_return_if_fail(!m_pdp_ptr); + m_pdp_ptr.reset(new PendingDocumentProperties(pDlg, pDoc_, pFrame_, filename_)); + } + boost::shared_ptr + getPendingDocProps() + { return m_pdp_ptr; } + void loadDocumentEnd() + { m_pdp_ptr.reset(); } + + +private: + void _disconnect(); + void _signal(); + bool _login(); + void _receive(); + void _message(const asio::error_code& e, + std::size_t bytes_transferred, + boost::shared_ptr msg_ptr); + + void _complete_packet(PacketPtr packet_ptr); + void _complete(const asio::error_code& e, std::size_t bytes_transferred, + PacketPtr packet_ptr); + + asio::io_service m_io_service; + std::string m_ca_file; + std::string m_address; + int m_port; + asio::ip::tcp::socket m_socket; + boost::shared_ptr m_thread_ptr; + std::string m_cookie; + UT_sint64 m_doc_id; + bool m_master; + std::string m_session_id; + realm::GrowBuffer m_buf; + SynchronizedQueue m_packet_queue; + boost::function m_sig; + std::vector m_buddies; + + boost::shared_ptr + m_pdp_ptr; + boost::shared_ptr + m_tls_tunnel_ptr; +}; + +typedef boost::shared_ptr ConnectionPtr; + +#endif /* __REALM_CONNECTION__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmGrowBuffer.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmGrowBuffer.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmGrowBuffer.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmGrowBuffer.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,58 @@ +#ifndef __REALM_GROW_BUFFER__ +#define __REALM_GROW_BUFFER__ + +namespace realm { + +class GrowBuffer { +public: + GrowBuffer(size_t capacity) + : m_capacity(capacity), + m_buf(capacity, '\0'), + m_index(0) + {} + + GrowBuffer() + : m_capacity(0), + m_buf(), + m_index(0) + {} + + void clear() { + if (m_buf.size() > m_capacity) + m_buf.resize(m_capacity); + m_index = 0; + } + + char* data() { + return &m_buf[0]; + } + + size_t size() { + return m_index; + } + + size_t free() { + return m_buf.size() - m_index; + } + + char* prepare(size_t capacity) { + if (free() < capacity) + m_buf.resize(m_buf.size() + (capacity - free())); + return &m_buf[m_index]; + } + + void commit(size_t capacity) { + if (m_index + capacity > m_buf.size()) + return; // TODO: throw exception + m_index += capacity; + } + +private: + size_t m_capacity; + std::string m_buf; + size_t m_index; +}; + +} + +#endif /* __REALM_GROW_BUFFER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmProtocol.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmProtocol.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/RealmProtocol.cpp 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/RealmProtocol.cpp 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,192 @@ +#include "RealmProtocol.h" + +namespace realm { + +namespace protocolv1 { + +#define MAX_PACKET_DATA_SIZE 64*1024*1024 + +#define RPV1_PACKET_NONEXISTENT -2 +#define RPV1_PACKET_VARIABLE -1 + +static uint32_t body_size[6] = { + RPV1_PACKET_NONEXISTENT, /* 0: reserved */ + RPV1_PACKET_VARIABLE, /* route; variable size */ + RPV1_PACKET_VARIABLE, /* deliver; variable size */ + RPV1_PACKET_VARIABLE, /* user joined */ + 1, /* user left */ + 0 /* session takeover */ +}; + +PacketPtr Packet::construct(uint8_t type) { + switch (type) { + case 0x00: /* reserved */ + return PacketPtr(); + case 0x01: /* route */ + return PacketPtr(new RoutingPacket()); + case 0x02: /* deliver */ + return PacketPtr(new DeliverPacket()); + case 0x03: /* user joined */ + return PacketPtr(new UserJoinedPacket()); + case 0x04: /* user left */ + return PacketPtr(new UserLeftPacket()); + case 0x05: /* session takeover */ + return PacketPtr(new SessionTakeOverPacket()); + } + + return PacketPtr(); +} + +Packet::Packet(uint8_t type) + : m_type(type) +{} + +bool Packet::s_valid(char type) { + return type > 0 && type < __LAST_PACKET__; +} + +uint32_t Packet::s_body_size(char type) { + return body_size[type]; +} + +int Packet::complete(const char* buf, size_t size) { + if (size >= body_size[m_type]) + return 0; + return body_size[m_type]-size; +} + +int PayloadPacket::complete(const char* buf, size_t size) { + if (size < 4+m_min_payload_size) + return 4+m_min_payload_size-size; + uint32_t payload_size = 0; + memcpy(&payload_size, &buf[0], 4); // FIXME: not Big Endian safe! + if (payload_size > MAX_PACKET_DATA_SIZE) + return -1; + if (size >= 4+payload_size) + return 0; + return 4+payload_size-size; +} + +int PayloadPacket::parse(const char* buf, size_t size) { + // read and check the payload size + if (size < 4+m_min_payload_size) + return -1; + uint32_t payload_size = 0; + memcpy(&payload_size, &buf[0], 4); // FIXME: not Big Endian safe! + if (size < 4 + payload_size || payload_size < m_min_payload_size || payload_size > MAX_PACKET_DATA_SIZE) + return -1; + m_payload_size = payload_size; + return 4; +} + +RoutingPacket::RoutingPacket() + : PayloadPacket(PACKET_ROUTE, 2), + m_address_count(0), + m_connection_ids(), + m_msg() +{} + +RoutingPacket::RoutingPacket(std::vector& connection_ids, boost::shared_ptr msg) + : PayloadPacket(PACKET_ROUTE, 2, 1 + connection_ids.size() + msg->size()), + m_address_count(connection_ids.size()), + m_connection_ids(connection_ids), + m_msg(msg) +{} + +int RoutingPacket::parse(const char* buf, size_t size) { + int parsed = PayloadPacket::parse(buf, size); + if (parsed == -1) + return -1; + // get the recipients + m_address_count = buf[parsed]; + if (m_address_count + 1 > getPayloadSize()) + return -1; + m_connection_ids.resize(m_address_count); + std::copy(buf+parsed+1, buf+parsed+1+m_address_count, m_connection_ids.begin()); + // get the message data + uint32_t msg_start = parsed+1+m_address_count; + uint32_t msg_size = getPayloadSize() - 1 - m_address_count; + m_msg.reset(new std::string(msg_size, '\0')); + std::copy(buf+msg_start, buf+msg_start+msg_size, (*m_msg).begin()); + return parsed + getPayloadSize(); +} + +DeliverPacket::DeliverPacket() + : PayloadPacket(PACKET_DELIVER, 1), + m_connection_id(0), + m_msg() +{} + +DeliverPacket::DeliverPacket(uint8_t connection_id, boost::shared_ptr msg) + : PayloadPacket(PACKET_DELIVER, 1, 1 + msg->size()), + m_connection_id(connection_id), + m_msg(msg) +{} + +int DeliverPacket::parse(const char* buf, size_t size) { + int parsed = PayloadPacket::parse(buf, size); + if (parsed == -1) + return -1; + // get the sender + m_connection_id = buf[parsed]; + // get the message data + uint32_t msg_start = parsed + 1; + uint32_t msg_size = getPayloadSize() - 1; + m_msg.reset(new std::string(msg_size, '\0')); + std::copy(buf+msg_start, buf+msg_start+msg_size, (*m_msg).begin()); + return parsed + getPayloadSize(); +} + +UserJoinedPacket::UserJoinedPacket() + : PayloadPacket(PACKET_USERJOINED, 2), + m_connection_id(0), + m_master(0), + m_userinfo() +{} + +UserJoinedPacket::UserJoinedPacket(uint8_t connection_id, bool master, boost::shared_ptr userinfo) + : PayloadPacket(PACKET_USERJOINED, 2, 2 + userinfo->size()), + m_connection_id(connection_id), + m_master(static_cast(master)), + m_userinfo(userinfo) +{} + +int UserJoinedPacket::parse(const char* buf, size_t size) { + int parsed = PayloadPacket::parse(buf, size); + if (parsed == -1) + return -1; + // get the user that joined + m_connection_id = buf[parsed]; + // get the master information + m_master = buf[parsed+1]; + // get the userinfo + uint32_t msg_start = parsed + 2; + uint32_t msg_size = getPayloadSize() - 2; + m_userinfo.reset(new std::string(msg_size, '\0')); + std::copy(buf+msg_start, buf+msg_start+msg_size, (*m_userinfo).begin()); + return parsed + getPayloadSize(); +} + +UserLeftPacket::UserLeftPacket() + : Packet(PACKET_USERLEFT), + m_connection_id(0) +{} + +UserLeftPacket::UserLeftPacket(uint8_t connection_id) + : Packet(PACKET_USERLEFT), + m_connection_id(connection_id) +{} + +int UserLeftPacket::parse(const char* buf, size_t size) { + if (size < 1) + return false; + m_connection_id = buf[0]; + return 1; +} + +SessionTakeOverPacket::SessionTakeOverPacket() + : Packet(PACKET_SESSIONTAKEOVER) +{} + +} +} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ServiceAccountHandler.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ServiceAccountHandler.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ServiceAccountHandler.cpp 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ServiceAccountHandler.cpp 2008-07-13 13:05:17.000000000 +0100 @@ -1,4 +1,5 @@ /* Copyright (C) 2006,2007 Marc Maurer + * Copyright (C) 2008 AbiSource Corporation B.V. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -16,32 +17,76 @@ * 02111-1307, USA. */ +#ifndef WIN32 +#include +#endif +#include +#include +#include "xap_App.h" +#include "xap_Frame.h" +#include "xap_DialogFactory.h" +#include "ut_debugmsg.h" +#include "ut_sleep.h" +#include "soa_soup.h" +#include "abicollab_types.h" +#include "AsyncWorker.h" +#include "ProgressiveSoapCall.h" +#include "RealmBuddy.h" +#include "ServiceBuddy.h" #include "ServiceAccountHandler.h" +#include "ap_Dialog_GenericInput.h" +#include +#include -/**************************************** - DocTreeItem -*****************************************/ -/*DocTreeItem::DocTreeItem() - : m_id(0), - m_name(""), - m_type(DOCTREEITEM_TYPE_NILL), - m_acl(DOCTREEITEM_ACL_PRIVATE), - m_data(0) -{ -} +namespace rpv1 = realm::protocolv1; -DocTreeItem::DocTreeItem(UT_sint64 id, const char* name, DocTreeItemType type, DocTreeItemAcl acl) - : m_id(id), - m_name(name), - m_type(type), - m_acl(acl), - m_data(0) +XAP_Dialog_Id ServiceAccountHandler::m_iDialogGenericInput = 0; +XAP_Dialog_Id ServiceAccountHandler::m_iDialogGenericProgress = 0; +AbiCollabSaveInterceptor ServiceAccountHandler::m_saveInterceptor = AbiCollabSaveInterceptor(); + +bool ServiceAccountHandler::askPassword(const std::string& email, std::string& password) { -}*/ + UT_DEBUGMSG(("ServiceAccountHandler::askPassword()\n")); + XAP_Frame* pFrame = XAP_App::getApp()->getLastFocussedFrame(); + UT_return_val_if_fail(pFrame, false); + + // ask for the service password + XAP_DialogFactory* pFactory = static_cast(XAP_App::getApp()->getDialogFactory()); + UT_return_val_if_fail(pFactory, false); + AP_Dialog_GenericInput* pDialog = static_cast( + pFactory->requestDialog(ServiceAccountHandler::getDialogGenericInputId()) + ); + + // Run the dialog + // TODO: make this translatable + pDialog->setTitle("AbiCollab.net Collaboration Service"); // FIXME: don't hardcode this title to abicollab.net + std::string msg = "Please enter your password for account '" + email + "'"; + pDialog->setQuestion(msg.c_str()); + pDialog->setLabel("Password:"); + pDialog->setPassword(true); + pDialog->runModal(pFrame); + + // get the results + bool cancel = pDialog->getAnswer() == AP_Dialog_GenericInput::a_CANCEL; + if (!cancel) + password = pDialog->getInput().utf8_str(); + pFactory->releaseDialog(pDialog); + + // the user terminated the input + return !cancel; +} ServiceAccountHandler::ServiceAccountHandler() - : AccountHandler() -{ + : AccountHandler(), + m_bOnline(false), + m_connections() +{ + m_ssl_ca_file = XAP_App::getApp()->getAbiSuiteLibDir(); +#if defined(WIN32) + m_ssl_ca_file += "\\certs\\cacert.pem"; +#else + m_ssl_ca_file += "/certs/cacert.pem"; +#endif } ServiceAccountHandler::~ServiceAccountHandler() @@ -51,17 +96,17 @@ UT_UTF8String ServiceAccountHandler::getDescription() { - return UT_UTF8String_sprintf("AbiWord Collaboration Service"); + return getProperty("email").c_str(); } UT_UTF8String ServiceAccountHandler::getDisplayType() { - return "AbiWord Collaboration Service"; + return "AbiCollab.net Collaboration Service"; } UT_UTF8String ServiceAccountHandler::getStorageType() { - return "com.abisource.abiword.abicollab.backend.service"; + return SERVICE_ACCOUNT_HANDLER_TYPE; } void ServiceAccountHandler::storeProperties() @@ -69,547 +114,808 @@ UT_DEBUGMSG(("ServiceAccountHandler::storeProperties() - TODO: implement me\n")); } +XAP_Dialog_Id ServiceAccountHandler::getDialogGenericInputId() +{ + // register the generic input dialog if we haven't already done that + // a bit hacky, but it works + if (m_iDialogGenericInput == 0) + { + XAP_DialogFactory * pFactory = static_cast(XAP_App::getApp()->getDialogFactory()); + m_iDialogGenericInput = pFactory->registerDialog(ap_Dialog_GenericInput_Constructor, XAP_DLGT_NON_PERSISTENT); + } + return m_iDialogGenericInput; +} + +XAP_Dialog_Id ServiceAccountHandler::getDialogGenericProgressId() +{ + // register the generic progress dialog if we haven't already done that + // a bit hacky, but it works + if (m_iDialogGenericProgress == 0) + { + XAP_DialogFactory * pFactory = static_cast(XAP_App::getApp()->getDialogFactory()); + m_iDialogGenericProgress = pFactory->registerDialog(ap_Dialog_GenericProgress_Constructor, XAP_DLGT_NON_PERSISTENT); + } + return m_iDialogGenericProgress; +} + ConnectResult ServiceAccountHandler::connect() { UT_DEBUGMSG(("ServiceAccountHandler::connect()\n")); - return CONNECT_INTERNAL_ERROR; + if (m_bOnline) + return CONNECT_SUCCESS; + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_val_if_fail(pManager, CONNECT_INTERNAL_ERROR); + + m_bOnline = true; + + // we are "connected" now, time to start sending out, and listening to messages (such as events) + pManager->registerEventListener(this); + + return CONNECT_SUCCESS; } bool ServiceAccountHandler::disconnect() { - UT_DEBUGMSG(("ServiceAccountHandler::disconnect() - TODO: implement me\n")); + UT_DEBUGMSG(("ServiceAccountHandler::disconnect()\n")); + UT_return_val_if_fail(m_bOnline, false); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_val_if_fail(pManager, false); + + m_bOnline = false; + + // TODO: send out an event we are going offline + // ... + + // we are disconnected now, no need to sent out messages (such as events) anymore + pManager->unregisterEventListener(this); + return true; } bool ServiceAccountHandler::isOnline() { - // TODO: implement me - return false; + return m_bOnline; } Buddy* ServiceAccountHandler::constructBuddy(const PropertyMap& props) { UT_DEBUGMSG(("ServiceAccountHandler::constructBuddy() - TODO: implement me\n")); - + UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); return NULL; // TODO: implement me } bool ServiceAccountHandler::send(const Packet* packet) { UT_DEBUGMSG(("ServiceAccountHandler::send(const Packet*)\n")); - return false; + // this are typically announce session broadcast events and the like, + // which we don't support in this backend + UT_ASSERT_HARMLESS(UT_NOT_IMPLEMENTED); + return true; } -bool ServiceAccountHandler::send(const Packet*, const Buddy& buddy) +bool ServiceAccountHandler::send(const Packet* packet, const Buddy& buddy) { UT_DEBUGMSG(("ServiceAccountHandler::send(const Packet*, const Buddy& buddy)\n")); - return false; + + const RealmBuddy& ourBuddy = static_cast(buddy); + uint8_t arr[] = { ourBuddy.realm_connection_id() }; + std::vector connection_ids(arr, arr+1); + + boost::shared_ptr data(new std::string()); + _createPacketStream( *data, packet ); + + _send(boost::shared_ptr(new rpv1::RoutingPacket(connection_ids, data)), ourBuddy.ptr()); + return true; } -/* -void s_parse_document(xmlNode* document, DocTreeItem* parent) +void ServiceAccountHandler::_write_handler(const asio::error_code& e, std::size_t bytes_transferred, + boost::shared_ptr recipient, boost::shared_ptr packet) { - if (!document || !parent) + if (e) + { + // TODO: disconnect buddy + UT_DEBUGMSG(("Error sending packet: %s\n", e.message().c_str())); return; + } + + UT_DEBUGMSG(("Packet sent: 0x%x\n", packet->type())); +} + +void ServiceAccountHandler::getSessionsAsync() +{ + UT_DEBUGMSG(("ServiceAccountHandler::getSessionsAsync()\n")); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + + pManager->beginAsyncOperation(this); + SessionBuddyPtr sessions_ptr(new std::vector()); + boost::shared_ptr > async_list_docs_ptr( + new AsyncWorker( + boost::bind(&ServiceAccountHandler::_listDocuments, this, + getProperty("uri"), getProperty("email"), getProperty("password"), sessions_ptr), + boost::bind(&ServiceAccountHandler::_listDocuments_cb, this, _1, sessions_ptr) + ) + ); + async_list_docs_ptr->start(); +} + +void ServiceAccountHandler::getSessionsAsync(const Buddy& buddy) +{ + UT_DEBUGMSG(("ServiceAccountHandler::getSessionsAsync(const Buddy& buddy)\n")); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + + // TODO: we shouldn't ignore the buddy parameter, but for now, we do ;) + + pManager->beginAsyncOperation(this); + SessionBuddyPtr sessions_ptr(new std::vector()); + boost::shared_ptr > async_list_docs_ptr( + new AsyncWorker( + boost::bind(&ServiceAccountHandler::_listDocuments, this, + getProperty("uri"), getProperty("email"), getProperty("password"), sessions_ptr), + boost::bind(&ServiceAccountHandler::_listDocuments_cb, this, _1, sessions_ptr) + ) + ); + async_list_docs_ptr->start(); +} - if (document->type == XML_ELEMENT_NODE) +bool ServiceAccountHandler::hasSession(const UT_UTF8String& sSessionId) +{ + for (std::vector >::iterator it = m_connections.begin(); it != m_connections.end(); it++) { - DocTreeItem* item = new DocTreeItem(); - // parse the document properties - for (xmlNode* prop = document->children; prop; prop = prop->next) - { - if (prop->type == XML_TEXT_NODE && prop->next) - { - prop = prop->next; - if (prop->type == XML_ELEMENT_NODE) - { - if (strcmp(reinterpret_cast(prop->name), "id") == 0) - { - UT_sint32 id = atoi(reinterpret_cast(xmlNodeGetContent(prop))); - if (id > 0) - item->m_id = id; - } - else if (strcmp(reinterpret_cast(prop->name), "name") == 0) - { - item->m_name = reinterpret_cast(xmlNodeGetContent(prop)); - } - else if (strcmp(reinterpret_cast(prop->name), "readonly") == 0) - { - // TODO: ... - } - else if (strcmp(reinterpret_cast(prop->name), "acl") == 0) - { - // TODO: ... - } - else - { - printf("unknown prop name: %s\n", prop->name); - UT_ASSERT_HARMLESS(false); - continue; - } - } - else - { - UT_DEBUGMSG(("Unexpected element in document - type: %d, name: %s", prop->type, prop->name)); - UT_ASSERT_HARMLESS(false); - } - } - } - parent->m_vecChildren.push_back(item); + boost::shared_ptr connection_ptr = *it; + UT_continue_if_fail(connection_ptr); + if (connection_ptr->session_id() == sSessionId.utf8_str()) + return true; } + return AccountHandler::hasSession(sSessionId); } -void s_parse_folder(xmlNode* folder, DocTreeItem* parent) +// NOTE: we don't implement the opening of documents asynchronous; we block on it, +// as it's annoying to opening them async. We need to change this API +void ServiceAccountHandler::joinSessionAsync(const Buddy& buddy, DocHandle& docHandle) { - if (!folder || !parent) + UT_DEBUGMSG(("ServiceAccountHandler::getSessionsAsync(const Buddy& buddy, DocHandle& docHandle)\n")); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + + UT_DEBUGMSG(("Joining document %s\n", docHandle.getSessionId().utf8_str())); + + UT_sint64 doc_id; + try { + doc_id = boost::lexical_cast(docHandle.getSessionId().utf8_str()); + } catch (boost::bad_lexical_cast &) { + // TODO: report error + UT_DEBUGMSG(("Error casting doc_id (%s) to an UT_sint64\n", docHandle.getSessionId().utf8_str())); return; + } + UT_return_if_fail(doc_id != 0); + UT_DEBUGMSG(("doc_id: %lld\n", doc_id)); - if (folder->type == XML_ELEMENT_NODE) + PD_Document* pDoc = NULL; + acs::SOAP_ERROR err = openDocument(doc_id, 0, docHandle.getSessionId().utf8_str(), &pDoc, NULL); + switch (err) { - const char* name = reinterpret_cast(xmlGetProp(folder, reinterpret_cast("name"))); - if (!name) - { - name = "Unknown folder"; - } - // TODO: get a folderId here (but it is not in the XML atm) - DocTreeItem* item = new DocTreeItem(0, name, DOCTREEITEM_TYPE_FOLDER, DOCTREEITEM_ALC_NILL); - // folders can contain documents or folders - xmlNode *folder_child = NULL; - for (folder_child = folder->children; folder_child; folder_child = folder_child->next) - { - if (folder_child->type == XML_ELEMENT_NODE) - { - if (strcmp(reinterpret_cast(folder_child->name), "document") == 0) + case acs::SOAP_ERROR_OK: + return; + case acs::SOAP_ERROR_INVALID_PASSWORD: + { + // TODO: asking for user input is not really nice in an async function + const std::string email = getProperty("email"); + std::string password; + if (askPassword(email, password)) { - s_parse_document(folder_child, item); - } - else if (strcmp(reinterpret_cast(folder_child->name), "folder") == 0) - { - s_parse_folder(folder_child, item); + // try again with the new password + addProperty("password", password); + pManager->storeProfile(); + joinSessionAsync(buddy, docHandle); } } - } - parent->m_vecChildren.push_back(item); + return; + default: + { + // TODO: add the document name, error type and perhaps the server name + UT_UTF8String msg("Error importing document "); + msg += docHandle.getName(); + msg += "."; + XAP_App::getApp()->getLastFocussedFrame()->showMessageBox(msg.utf8_str(), XAP_Dialog_MessageBox::b_O, XAP_Dialog_MessageBox::a_OK); + } + break; } } -void s_parse_group_elements(xmlNode* group, DocTreeItem* parent) +acs::SOAP_ERROR ServiceAccountHandler::openDocument(UT_sint64 doc_id, UT_sint64 revision, const std::string& session_id, PD_Document** pDoc, XAP_Frame* pFrame) { - xmlNode *group_element = NULL; - for (group_element = group->children; group_element; group_element = group_element->next) + UT_DEBUGMSG(("ServiceAccountHandler::openDocument() - doc_id: %lld\n", doc_id)); + + const std::string uri = getProperty("uri"); + const std::string email = getProperty("email"); + const std::string password = getProperty("password"); + + // construct a SOAP method call to gets our documents + soa::function_call fc("openDocument", "openDocumentResponse"); + fc("email", email)("password", password)("doc_id", doc_id)("revision", static_cast(revision)); + + // execute the call + boost::shared_ptr call(new ProgressiveSoapCall(uri, fc, m_ssl_ca_file)); + soa::GenericPtr soap_result; + try { + soap_result = call->run(); + } catch (soa::SoapFault& fault) { + UT_DEBUGMSG(("Caught a soap fault: %s (error code: %s)!\n", + fault.detail() ? fault.detail()->value().c_str() : "(null)", + fault.string() ? fault.string()->value().c_str() : "(null)")); + return acs::error(fault); + } + UT_return_val_if_fail(soap_result, acs::SOAP_ERROR_GENERIC); + + // handle the result + soa::CollectionPtr rcp = soap_result->as("return"); + UT_return_val_if_fail(rcp, acs::SOAP_ERROR_GENERIC); + + soa::StringPtr realm_address = rcp->get("realm_address"); + soa::IntPtr realm_port = rcp->get("realm_port"); + soa::StringPtr cookie = rcp->get("cookie"); + + // some sanity checking + soa::BoolPtr master = rcp->get("master"); + if (!master) { - if (group_element->type == XML_ELEMENT_NODE) - { - if (strcmp(reinterpret_cast(group_element->name), "document") == 0) - { - s_parse_document(group_element, parent); - } - else if (strcmp(reinterpret_cast(group_element->name), "folder") == 0) - { - s_parse_folder(group_element, parent); - } - } + UT_DEBUGMSG(("Error reading master field\n")); + return acs::SOAP_ERROR_GENERIC; + } + if (!realm_address || realm_address->value().size() == 0 || !realm_port || realm_port->value() <= 0 || !cookie || cookie->value().size() == 0) + { + UT_DEBUGMSG(("Invalid realm login information\n")); + return acs::SOAP_ERROR_GENERIC; + } + soa::StringPtr filename_ptr = rcp->get("filename"); + if (!filename_ptr) + { + UT_DEBUGMSG(("Error reading filename field\n")); + return acs::SOAP_ERROR_GENERIC; + } + // check the filename; it shouldn't ever be empty, but just check nonetheless + // TODO: append a number if the filename happens to be empty + std::string filename = filename_ptr->value().size() > 0 ? filename_ptr->value() : "Untitled"; + + // open the realm connection! + UT_DEBUGMSG(("realm_address: %s, realm_port: %lld, cookie: %s\n", realm_address->value().c_str(), realm_port->value(), cookie->value().c_str())); + ConnectionPtr connection = + boost::shared_ptr(new RealmConnection(m_ssl_ca_file, realm_address->value(), + realm_port->value(), cookie->value(), doc_id, master->value(), session_id, + boost::bind(&ServiceAccountHandler::_handleRealmPacket, this, _1))); + + // TODO: this connect() call is blocking, so it _could_ take a while; we should + // display a progress bar in that case + if (!connection->connect()) + { + UT_DEBUGMSG(("Error connecting to realm %s:%d\n", realm_address->value().c_str(), realm_port->value())); + return acs::SOAP_ERROR_GENERIC; } + + // load the document + acs::SOAP_ERROR open_result = master->value() + ? _openDocumentMaster(rcp, pDoc, pFrame, session_id, filename) + : _openDocumentSlave(connection, pDoc, pFrame, filename); + + if (open_result != acs::SOAP_ERROR_OK) + { + UT_DEBUGMSG(("Error opening document!\n")); + // TODO: also nuke the queue! + connection->disconnect(); + return acs::SOAP_ERROR_GENERIC; + } + + UT_DEBUGMSG(("Document loaded successfully\n")); + m_connections.push_back(connection); + return acs::SOAP_ERROR_OK; +} + +acs::SOAP_ERROR ServiceAccountHandler::_openDocumentMaster(soa::CollectionPtr rcp, PD_Document** pDoc, XAP_Frame* pFrame, + const std::string& session_id, const std::string& filename) +{ + UT_return_val_if_fail(rcp || pDoc, acs::SOAP_ERROR_GENERIC); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_val_if_fail(pManager, acs::SOAP_ERROR_GENERIC); + + soa::StringPtr document = rcp->get("document"); + UT_return_val_if_fail(document, acs::SOAP_ERROR_GENERIC); + + // construct the document + UT_return_val_if_fail(AbiCollabSessionManager::deserializeDocument(pDoc, document->value(), true) == UT_OK, acs::SOAP_ERROR_GENERIC); + UT_return_val_if_fail(*pDoc, acs::SOAP_ERROR_GENERIC); + + // set the filename + gchar* fname = g_strdup(filename.c_str()); + (*pDoc)->setFilename(fname); + + // start the session + UT_UTF8String sSessionId = session_id.c_str(); + pManager->startSession(*pDoc, sSessionId, pFrame); + + return acs::SOAP_ERROR_OK; +} +acs::SOAP_ERROR ServiceAccountHandler::_openDocumentSlave(ConnectionPtr connection, PD_Document** pDoc, XAP_Frame* pFrame, const std::string& filename) +{ + UT_DEBUGMSG(("ServiceAccountHandler::_openDocumentSlave()\n")); + UT_return_val_if_fail(connection, acs::SOAP_ERROR_GENERIC); + UT_return_val_if_fail(pDoc, acs::SOAP_ERROR_GENERIC); + + // get the progress dialog + XAP_Frame* pDlgFrame = XAP_App::getApp()->getLastFocussedFrame(); + UT_return_val_if_fail(pDlgFrame, acs::SOAP_ERROR_GENERIC); + + XAP_DialogFactory* pFactory = static_cast(XAP_App::getApp()->getDialogFactory()); + UT_return_val_if_fail(pFactory, acs::SOAP_ERROR_GENERIC); + + AP_Dialog_GenericProgress* pDlg = static_cast( + pFactory->requestDialog(ServiceAccountHandler::getDialogGenericProgressId()) + ); + pDlg->setTitle("Retrieving Document"); + pDlg->setInformation("Please wait while retrieving document..."); + + // setup the information for the callback to use when the document comes in + connection->loadDocumentStart(pDlg, pDoc, pFrame, filename); + + // run the dialog + pDlg->runModal(pDlgFrame); + UT_DEBUGMSG(("Progress dialog destroyed...\n")); + bool m_cancelled = pDlg->getAnswer() == AP_Dialog_GenericProgress::a_CANCEL; + pFactory->releaseDialog(pDlg); + connection->loadDocumentEnd(); + + if (m_cancelled) + return acs::SOAP_ERROR_GENERIC; + + return acs::SOAP_ERROR_OK; } -void s_parse_groups(xmlNode* root, std::vector& vecDocTreeItems) +// FIXME: this function can be called from another thread; +// don't allow it to access data from the main thread +// NOTE: saveDocument can be called from a thread other than our mainloop; +// Don't let access or modify any data from the mainloop! +// FIXME FIXME FIXME: we should NOT touch m_connections!!!! +UT_Error ServiceAccountHandler::saveDocument(PD_Document* pDoc, const UT_UTF8String& sSessionId) { - xmlNode *group = NULL; - for (group = root->children; group; group = group->next) + UT_DEBUGMSG(("Saving document with session id %s to webservice!\n", sSessionId.utf8_str())); + UT_return_val_if_fail(pDoc, UT_ERROR); + + // find the realm connection beloning to this session to fetch the document id + for (std::vector >::iterator it = m_connections.begin(); it != m_connections.end(); it++) { - if (group->type == XML_ELEMENT_NODE) + boost::shared_ptr connection_ptr = *it; + UT_continue_if_fail(connection_ptr); + if (connection_ptr->session_id() == sSessionId.utf8_str()) { - UT_UTF8String prettyName; - if (strcmp(reinterpret_cast(group->name), "owner") == 0) - { - prettyName = "My Documents"; - } - else if (strcmp(reinterpret_cast(group->name), "friends") == 0) - { - prettyName = "My Friends' Documents"; - } - else if (strcmp(reinterpret_cast(group->name), "groups") == 0) - { - prettyName = "My Groups' Documents"; - } - else - { - UT_ASSERT_HARMLESS(false); - continue; + UT_DEBUGMSG(("Saving document id %lld\n", connection_ptr->doc_id())); + + const std::string uri = getProperty("uri"); + const std::string email = getProperty("email"); + const std::string password = getProperty("password"); + boost::shared_ptr document(new std::string("")); + if (AbiCollabSessionManager::serializeDocument(pDoc, *document, true) != UT_OK) + return UT_ERROR; + + // construct a SOAP method call to gets our documents + soa::function_call fc("saveDocument", "saveDocumentResponse"); + fc("email", email) + ("password", password) + ("doc_id", connection_ptr->doc_id()) + (soa::Base64Bin("data", document)); + + // execute the call and ignore the result (the revision number stored) + try { + soa::GenericPtr soap_result = soup_soa::invoke(uri, soa::method_invocation("urn:AbiCollabSOAP", fc), m_ssl_ca_file); + UT_return_val_if_fail(soap_result, UT_ERROR); + } catch (soa::SoapFault& fault) { + UT_DEBUGMSG(("Caught a soap fault: %s (error code: %s)!\n", + fault.detail() ? fault.detail()->value().c_str() : "(null)", + fault.string() ? fault.string()->value().c_str() : "(null)")); + return UT_ERROR; } - // First param on the next line is unused for groups - DocTreeItem* item = new DocTreeItem(0, prettyName.utf8_str(), DOCTREEITEM_TYPE_ROOT, DOCTREEITEM_ALC_NILL); - vecDocTreeItems.push_back(item); - s_parse_group_elements(group, item); + return UT_OK; } } -}*/ -void ServiceAccountHandler::populateDocuments(const UT_UTF8String& packet) + return UT_ERROR; +} + +void ServiceAccountHandler::signal(const Event& event, const Buddy* pSource) { -/* m_vecDocTreeItems.clear(); // TODO: we have to free all items + UT_DEBUGMSG(("ServiceAccountHandler::signal()\n")); + + // NOTE: do NOT let AccountHandler::signal() send broadcast packets! + // It will send them to all buddies, including the ones we created + // to list the available documents: ServiceBuddies. They are just fake + // buddies however, and can't receive real packets. Only RealmBuddy's + // can be sent packets - UT_DEBUGMSG(("Incoming packet:\n%s\n", packet.utf8_str())); - xmlNode *root_element = NULL; - xmlDocPtr doc = xmlReadMemory (packet.utf8_str(), packet.length(), 0, "UTF-8", 0); - if (doc == NULL) - { - UT_DEBUGMSG(("Error parsing document XML tree!\n")); - UT_ASSERT(UT_SHOULD_NOT_HAPPEN); - return; - } + // Note: there is no real need to pass the PCT_CloseSessionEvent and + // PCT_DisjoinSessionEvent signals to the AccountHandler::signal() + // function: that one will send all buddies the 'session is closed' + // signal. However, on this backend, the abicollab.net realm will + // handle that for us - root_element = xmlDocGetRootElement(doc); - if (root_element) + switch (event.getClassType()) { - // we only expect 1 root element (GetDocumentResponse) - UT_ASSERT(root_element->next == 0); - s_parse_groups(root_element, m_vecDocTreeItems); + case PCT_CloseSessionEvent: + { + UT_DEBUGMSG(("Got a PCT_CloseSessionEvent, disconnecting the realm connection...\n")); + const CloseSessionEvent cse = static_cast(event); + UT_return_if_fail(!pSource); // we shouldn't receive these events over the wire on this backend + ConnectionPtr connection_ptr = _getConnection(cse.getSessionId().utf8_str()); + UT_return_if_fail(connection_ptr); + connection_ptr->disconnect(); + } + break; + case PCT_DisjoinSessionEvent: + { + UT_DEBUGMSG(("Got a PCT_DisjoinSessionEvent, disconnecting the realm connection...\n")); + const DisjoinSessionEvent dse = static_cast(event); + UT_return_if_fail(!pSource); // we shouldn't receive these events over the wire on this backend + ConnectionPtr connection_ptr = _getConnection(dse.getSessionId().utf8_str()); + UT_return_if_fail(connection_ptr); + connection_ptr->disconnect(); + } + break; + case PCT_StartSessionEvent: + // TODO: users should get this I guess, but I don't know a proper way to implement this yet + break; + default: + // TODO: implement me + break; } - xmlCleanupParser(); - xmlFreeDoc(doc); - - // signal the listeners we have (atm, that is only the Documents dialog) - if (m_pDocDialog) - { - m_pDocDialog->repopulate(); - }*/ } -void ServiceAccountHandler::updateDocumentsAsync() -{ -/* UT_return_if_fail(m_pHandler); - - m_pHandler->send( - UT_UTF8String(""), - getAbiterString() - ); - */ -} - -void ServiceAccountHandler::openDocumentAsync(UT_sint64 docId) -{ -/* UT_return_if_fail(m_pHandler); - char buf[24]; // ick - snprintf(buf, sizeof(buf), "%d", docId); +// NOTE: _listDocuments can be called from a thread other than our mainloop; +// Don't let access or modify any data from the mainloop! +acs::SOAP_ERROR ServiceAccountHandler::_listDocuments( + const std::string uri, const std::string email, const std::string password, + SessionBuddyPtr sessions_ptr) +{ + UT_DEBUGMSG(("ServiceAccountHandler::_listDocuments()\n")); + UT_return_val_if_fail(sessions_ptr, acs::SOAP_ERROR_GENERIC); + + // construct a SOAP method call to gets our documents + soa::function_call fc("listDocuments", "listDocumentsResponse"); + fc("email", email)("password", password); + + soa::GenericPtr soap_result; + try { + soap_result = soup_soa::invoke(uri, soa::method_invocation("urn:AbiCollabSOAP", fc), m_ssl_ca_file); + } catch (soa::SoapFault& fault) { + UT_DEBUGMSG(("Caught a soap fault: %s (error code: %s)!\n", + fault.detail() ? fault.detail()->value().c_str() : "(null)", + fault.string() ? fault.string()->value().c_str() : "(null)")); + return acs::error(fault); + } + if (!soap_result) + return acs::SOAP_ERROR_GENERIC; - UT_UTF8String odr; - odr += ""; - odr += ""; - odr += &buf[0]; - odr += ""; - odr += ""; - XAP_Frame * pFrame = XAP_App::getApp()->getLastFocussedFrame(); - pFrame->setCursor(GR_Graphics::GR_CURSOR_WAIT); - m_pHandler->send(odr, getAbiterString());*/ + // handle the result + soa::CollectionPtr rcp = soap_result->as("return"); + UT_return_val_if_fail(rcp, acs::SOAP_ERROR_GENERIC); + + // load our own files + GetSessionsResponseEvent gsre; + _parseSessionFiles(rcp->get< soa::Array >("files"), gsre); + sessions_ptr->push_back( std::make_pair(gsre, new ServiceBuddy(this, email.c_str()) )); + + // load the files from our friends + if (soa::ArrayPtr friends_array = rcp->get< soa::Array >("friends")) + if (abicollab::FriendArrayPtr friends = friends_array->construct()) + for (size_t i = 0; i < friends->size(); i++) + if (abicollab::FriendPtr friend_ = friends->operator[](i)) + { + UT_DEBUGMSG(("Got a friend: %s <%s>\n", friend_->name.c_str(), friend_->email.c_str())); + if (friend_->email != "") + { + // add this friend's documents by generating a GetSessionsResponseEvent + // to populate all the required document structures + GetSessionsResponseEvent gsre; + _parseSessionFiles(friend_->files, gsre); + sessions_ptr->push_back( std::make_pair(gsre, new ServiceBuddy(this, friend_->email.c_str()) )); + } + } + + // load the files from our groups + if (soa::ArrayPtr groups_array = rcp->get< soa::Array >("groups")) + if (abicollab::GroupArrayPtr groups = groups_array->construct()) + for (size_t i = 0; i < groups->size(); i++) + if (abicollab::GroupPtr group_ = groups->operator[](i)) + { + UT_DEBUGMSG(("Got a group: %s\n", group_->name.c_str())); + if (group_->name != "") + { + // add this friend's documents by generating a GetSessionsResponseEvent + // to populate all the required document structures + GetSessionsResponseEvent gsre; + _parseSessionFiles(group_->files, gsre); + sessions_ptr->push_back( std::make_pair(gsre, new ServiceBuddy(this, group_->name.c_str()) )); + } + } + + return acs::SOAP_ERROR_OK; } -void ServiceAccountHandler::saveDocumentAsync(UT_sint64 docId, PD_Document * pDoc) +void ServiceAccountHandler::_listDocuments_cb(acs::SOAP_ERROR error, SessionBuddyPtr sessions_ptr) { -/* UT_return_if_fail(m_pHandler); // TODO: notify the user + UT_DEBUGMSG(("ServiceAccountHandler::_listDocuments_cb()\n")); + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); - UT_UTF8String odr; - odr += ""; + pManager->endAsyncOperation(this); + + UT_return_if_fail(sessions_ptr); + + switch (error) + { + case acs::SOAP_ERROR_OK: + { + std::vector& sessions = *sessions_ptr; + for (std::vector::iterator it = sessions.begin(); it != sessions.end(); it++) + { + ServiceBuddy* pBuddy = (*it).second; + UT_continue_if_fail(pBuddy); + Buddy* pExistingBuddy = getBuddy(pBuddy->getName()); + if (!pExistingBuddy) + { + pExistingBuddy = pBuddy; + addBuddy(pBuddy); + } + else + DELETEP(pBuddy); + _handlePacket(&((*it).first), pExistingBuddy, false); + } + } + break; + case acs::SOAP_ERROR_INVALID_PASSWORD: + { + // FIXME: should we ask for a password in an async callback? + const std::string email = getProperty("email"); + std::string password; + if (askPassword(email, password)) + { + // store the new password + addProperty("password", password); + pManager->storeProfile(); + + // re-attempt to fetch the documents list + pManager->beginAsyncOperation(this); + SessionBuddyPtr new_sessions_ptr(new std::vector()); + boost::shared_ptr > async_list_docs_ptr( + new AsyncWorker( + boost::bind(&ServiceAccountHandler::_listDocuments, this, + getProperty("uri"), getProperty("email"), getProperty("password"), new_sessions_ptr), + boost::bind(&ServiceAccountHandler::_listDocuments_cb, this, _1, new_sessions_ptr) + ) + ); + async_list_docs_ptr->start(); + } + } + return; + default: + // FIXME: maybe determine the exact error + /// TODO: show a message box? + UT_DEBUGMSG(("Caught SOAP error: %d\n", error)); + UT_return_if_fail(error == acs::SOAP_ERROR_OK); + } +} - UT_UTF8String document; - bool b = s_CollabFactoryContainer.fillDocumentString(document, pDoc); - UT_return_if_fail(b); // TODO: notify the user +void ServiceAccountHandler::_handleJoinSessionRequestResponse( + JoinSessionRequestResponseEvent* jsre, Buddy* pBuddy, + XAP_Frame* pFrame, PD_Document** pDoc, const std::string& filename) +{ + UT_return_if_fail(jsre); + UT_return_if_fail(pBuddy); + UT_return_if_fail(pDoc); + + UT_DEBUGMSG(("_handleJoinSessionRequestResponse() - pFrame: 0x%x\n", pFrame)); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + + UT_return_if_fail(AbiCollabSessionManager::deserializeDocument(pDoc, jsre->m_sZABW, false) == UT_OK); + UT_return_if_fail(*pDoc); - odr += "setFilename(fname); - odr += ""; - UT_UTF8String sCAC = getAbiterString(); - m_pHandler->send(odr, sCAC.utf8_str());*/ + pManager->joinSession(jsre->getSessionId(), *pDoc, jsre->m_sDocumentId, jsre->m_iRev, pBuddy, pFrame); } -void ServiceAccountHandler::closeDocument(UT_sint64 docId, PD_Document * pDoc) +void ServiceAccountHandler::_handleRealmPacket(RealmConnection& connection) { -/* UT_return_if_fail(m_pHandler); + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); - UT_UTF8String odr; - odr += "\n"; - odr += ""; - odr += UT_UTF8String_sprintf("%d",docId); - odr += "\n"; - odr += ""; - UT_UTF8String sCAC = getAbiterString(); - UT_DEBUGMSG(("sending |%s| \n to |%s| \n",odr.utf8_str(),sCAC.utf8_str())); - m_pHandler->send(odr, sCAC.utf8_str());*/ -} + // make sure we have handled _all_ packets in the queue before checking + // the disconnected status + bool disconnected = !connection.isConnected(); + _handleMessages(connection); -/* + if (disconnected) + { + UT_DEBUGMSG(("RealmConnection is not connected anymore (this was a %s connection)!\n", connection.master() ? "master" : "slave")); + std::vector buddies = connection.getBuddies(); + for (std::vector::iterator it = buddies.begin(); it != buddies.end(); it++) + { + RealmBuddyPtr realm_buddy_ptr = *it; + UT_continue_if_fail(realm_buddy_ptr); + UT_DEBUGMSG(("Lost connection to buddy with connection id: %d\n", realm_buddy_ptr->realm_connection_id())); + pManager->removeBuddy(realm_buddy_ptr.get(), false); + } + + // remove the connection from our connection list + _removeConnection(connection.session_id()); + } + + // check other things here if needed... +} -void s_handle_service_import_event(UT_Worker * pWorker) +ConnectionPtr ServiceAccountHandler::_getConnection(const std::string& session_id) { - AbiCollab* pCollab = reinterpret_cast(pWorker->getInstanceData()); - pCollab->handleImportEvent(); + for (std::vector::iterator it = m_connections.begin(); it != m_connections.end(); it++) + { + UT_continue_if_fail(*it); + if ((*it)->session_id() == session_id) + return *it; + } } -static bool s_handle_service_message(const AbiCollab_Packet_Data *pAPD) +void ServiceAccountHandler::_removeConnection(const std::string& session_id) { - AbiCollabService* pService = AbiCollabService::getService(); - UT_return_val_if_fail(pService, false); - - xmlDocPtr doc = xmlReadMemory (pAPD->packet.utf8_str(), pAPD->packet.length(), 0, "UTF-8", 0); - UT_return_val_if_fail(doc, false); - UT_DEBUGMSG(("Received service packet\n")); - xmlNode *response_element = xmlDocGetRootElement(doc); - if (response_element) + UT_DEBUGMSG(("ServiceAccountHandler::_removeConnection()\n")); + for (std::vector::iterator it = m_connections.begin(); it != m_connections.end(); it++) { - // we only expect 1 root element (GetDocumentResponse) - UT_ASSERT(response_element->next == 0); - - UT_DEBUGMSG(("got resp: %s\n", reinterpret_cast(response_element->name))); - - if (strcmp(reinterpret_cast(response_element->name), "GetDocumentsResponse") == 0) + UT_continue_if_fail(*it); + ConnectionPtr connection = *it; + UT_DEBUGMSG(("looking at connection with session id <%s>, closing session <%s>\n", connection->session_id().c_str(), session_id.c_str())); + if (connection->session_id() == session_id) { - // FIXME FIXME: don't re-parse!!! - pService->populateDocuments(pAPD->packet); + UT_DEBUGMSG(("connection dropped\n")); + m_connections.erase(it); + return; } - else if(strcmp(reinterpret_cast(response_element->name), "SaveDocumentResponse") == 0) + } +} + +void ServiceAccountHandler::_handleMessages(RealmConnection& connection) +{ + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + + while (connection.queue().peek()) + { + rpv1::PacketPtr packet = connection.queue().pop(); + UT_continue_if_fail(packet); + + switch (packet->type()) { - UT_DEBUGMSG(("SaveResponsePacked |%s| \n",pAPD->packet.utf8_str())); - bool bSavedOK = false; - for (xmlNode* document_node = response_element->children; document_node; document_node = document_node->next) - { - UT_DEBUGMSG(("Document_node type %d \n",document_node->type)); - if (document_node->type == XML_ELEMENT_NODE) + case rpv1::PACKET_DELIVER: { - UT_DEBUGMSG(("Inside Document_node name |%s| \n",document_node->name)); - if (strcmp(reinterpret_cast(document_node->name),"status") == 0) + UT_DEBUGMSG(("Received a 'Deliver' packet!\n")); + boost::shared_ptr dp = + boost::static_pointer_cast(packet); + UT_return_if_fail(dp->getMessage()); + + boost::shared_ptr buddy_ptr = + connection.getBuddy(dp->getConnectionId()); + UT_return_if_fail(buddy_ptr); + + Packet* pPacket = _createPacket(*dp->getMessage(), buddy_ptr.get()); + UT_return_if_fail(pPacket); + + if (pPacket->getClassType() == PCT_JoinSessionRequestResponseEvent) { - UT_DEBUGMSG(("Found Status \n")); - const char* statusVal = reinterpret_cast(xmlNodeGetContent(document_node)); - if(statusVal) - { - UT_UTF8String sStatusVal =statusVal; - FREEP(statusVal); - if(strcmp(sStatusVal.utf8_str(),"success")==0) - { - bSavedOK = true; - } - } - else - { - break; - } + UT_DEBUGMSG(("Trapped a JoinSessionRequestResponseEvent!\n")); + boost::shared_ptr pdp = connection.getPendingDocProps(); + UT_return_if_fail(pdp); + + UT_DEBUGMSG(("Joining received document...")); + _handleJoinSessionRequestResponse(static_cast(pPacket), buddy_ptr.get(), pdp->pFrame, pdp->pDoc, pdp->filename); + DELETEP(pPacket); + UT_return_if_fail(pdp->pDlg); + pdp->pDlg->close(); + continue; } + + // let the default handler handle this packet + // NOTE: this will delete the packet as well (ugly design) + handleMessage(pPacket, buddy_ptr.get()); } - } - if(!bSavedOK) - { - XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); - pFrame->showMessageBox(szFailedToSave, - XAP_Dialog_MessageBox::b_O, - XAP_Dialog_MessageBox::a_OK); - - } - else - { - XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); - PD_Document* pDoc = static_cast(pFrame->getCurrentDoc()); - FV_View * pView = static_cast(pFrame->getCurrentView()); - pDoc->setClean(); - pView->notifyListeners(AV_CHG_SAVE); - } - } - else if (strcmp(reinterpret_cast(response_element->name), "OpenDocumentResponse") == 0) - { - for (xmlNode* document_node = response_element->children; document_node; document_node = document_node->next) - { - UT_DEBUGMSG(("Outside Document_node name |%s| \n",document_node->name)); - UT_DEBUGMSG(("Document_node type %d \n",document_node->type)); - if (document_node->type == XML_ELEMENT_NODE) + break; + case rpv1::PACKET_USERJOINED: { - UT_DEBUGMSG(("Inside Document_node name |%s| \n",document_node->name)); - if (strcmp(reinterpret_cast(document_node->name),"document") == 0) - { - UT_UTF8String sID = reinterpret_cast(xmlGetProp(document_node, reinterpret_cast("id"))); - UT_DEBUGMSG(("got document!!!!! %s id = %s \n", document_node->name,sID.utf8_str())); - UT_sint64 iID = atoi(sID.utf8_str()); - //printf("doc content:\n%s\n", reinterpret_cast(xmlNodeGetContent(document_node))); - - // TODO: move this out - // - // Get Document name - // - const char *szDocname = reinterpret_cast(xmlGetProp(document_node, reinterpret_cast("name"))); - const char* base64gzBuf = reinterpret_cast(xmlNodeGetContent(document_node)); - //printf("from xml: %s\n", base64gzBuf); - size_t gzbufLen = gsf_base64_decode_simple((guint8*)base64gzBuf, strlen(base64gzBuf)); - char* gzBuf = (char*) base64gzBuf; - // TODO: do we need to pass false here? - GsfInput *source = gsf_input_memory_new((guint8*)gzBuf, gzbufLen, false); - GsfInput *gzabwBuf = gsf_input_gzip_new (source, NULL); // todo: don't pass null here, but check for errors - // unzip the document - gsf_off_t abwLen = gsf_input_size(gzabwBuf); - char* abwBuf = (char*)malloc(abwLen+1); - gsf_input_seek(gzabwBuf, 0, G_SEEK_SET); - gsf_input_read(gzabwBuf, abwLen, (guint8*)abwBuf); - abwBuf[abwLen] = '\0'; - - XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); - if(!pFrame || pFrame->isDirty() || (pFrame->getFilename() != NULL)) - { - pFrame = XAP_App::getApp()->newFrame(); - if (!pFrame) - { - return false; - } - - // Open a complete but blank frame, then load the document into it - - UT_Error errorCode = pFrame->loadDocument(NULL, IEFT_Unknown); - if (!errorCode) - { - pFrame->show(); - } - else - { - return false; - } - } - PD_Document* pDoc = new PD_Document(XAP_App::getApp()); - pDoc->createRawDocument(); - IE_Imp_XML* imp = (IE_Imp_XML*)new IE_Imp_AbiWord_1(pDoc); - imp->importFile(abwBuf, abwLen); // todo: check for errors - pDoc->finishRawCreation(); - pFrame->loadDocument(pDoc); - FREEP(abwBuf); - DELETEP(imp); - - g_object_unref(G_OBJECT(source)); - AbiCollabService_Export * pExport = new AbiCollabService_Export(pDoc,iID); - UT_uint32 lid = 0; - pDoc->addListener(static_cast(pExport), &lid); - UT_UTF8String sUTF8(""); - AbiCollab* pCollab = s_CollabFactoryContainer.create(0, sUTF8, false, NULL); - const UT_UTF8String sServer(CAC_SERVER); - bool b = pCollab->createHandler(sServer,5222,s_UserName,s_Password,NULL); - if(!b) - return false; - pCollab->setDocument(pDoc); - pCollab->setServiceID(iID); - pCollab->setOffering(true); - pCollab->startRemoteListener(); - if(szDocname) - { - UT_DEBUGMSG(("Docname %s \n",szDocname)); - pDoc->setFilename(const_cast(szDocname)); - } - pFrame->updateTitle(); - UT_DEBUGMSG(("We are offering a collaboration from a c.a.c doc!\n")); + UT_DEBUGMSG(("Received a 'User Joined' packet!\n")); + boost::shared_ptr ujp = + boost::static_pointer_cast(packet); + if (connection.master()) + { + UT_DEBUGMSG(("We're master, adding buddy to our buddy list\n")); + UT_return_if_fail(!ujp->isMaster()); + connection.addBuddy(boost::shared_ptr( + new RealmBuddy(this, static_cast(ujp->getConnectionId()), false, connection))); } - else if(strcmp(reinterpret_cast(document_node->name),"host")==0) + else { - UT_DEBUGMSG(("Host_node name |%s| \n",document_node->name)); - UT_UTF8String sID = reinterpret_cast(xmlGetProp(document_node, reinterpret_cast("docId"))); - UT_sint64 iID = atoi(sID.utf8_str()); - const char* szName = reinterpret_cast(xmlNodeGetContent(document_node)); - // - // strip off the resource - // - UT_String sName = szName; - UT_sint32 i = 0; - for(i=0; iisMaster()) { - if(sName[i] == '/') - break; + UT_DEBUGMSG(("Received master buddy (id: %d); we're slave, adding it to our buddy list!\n", ujp->getConnectionId())); + boost::shared_ptr master_buddy( + new RealmBuddy(this, static_cast(ujp->getConnectionId()), true, connection)); + connection.addBuddy(master_buddy); + + UT_DEBUGMSG(("Sending join session request to master!\n")); + JoinSessionRequestEvent event( connection.session_id().c_str() ); + send(&event, *master_buddy); } - UT_UTF8String sHostUsername = szName; - if(icreateHandler(sServer,5222,s_UserName,s_Password,sHostUsername.utf8_str()); - if(!b) - return false; - pCollab->setServiceID(iID); - // - // Need to attach a CAC listener to the - // document after it has been loaded. - // We'll create one here and make - // AbiCollab finish the attachments after - // loading the remote doc - // - pCollab->setExportServiceListener(static_cast(new AbiCollabService_Export(NULL,iID))); - pCollab->startRemoteListener(); + else + UT_DEBUGMSG(("Received a slave buddy (id: %d); we're slave; dropping it on the floor for now\n", ujp->getConnectionId())); } } - } - } - else - { - // - // Authorise a remote user to join the collaboration - // + break; + case rpv1::PACKET_USERLEFT: + { + UT_DEBUGMSG(("Received a 'User Left' packet!\n")); + boost::shared_ptr ulp = + boost::static_pointer_cast(packet); + RealmBuddyPtr realm_buddy_ptr = connection.getBuddy(ulp->getConnectionId()); + if (!realm_buddy_ptr) + return; // we don't store slave buddies at the moment, so this happens when a slave disconnects + UT_DEBUGMSG(("removing %s buddy with connection id %d from all sessions\n", realm_buddy_ptr->master() ? "master" : "slave", realm_buddy_ptr->realm_connection_id())); + pManager->removeBuddy(realm_buddy_ptr.get(), false); + connection.removeBuddy(ulp->getConnectionId()); + // if this was the master, then we can close the realm connection + if (realm_buddy_ptr->master()) + { + UT_DEBUGMSG(("The master buddy left; disconnecting the realm connection!\n")); + connection.disconnect(); + return; + } + } + break; + default: + UT_DEBUGMSG(("Dropping unrecognized packet on the floor (type: 0x%x)!\n", packet->type())); + UT_ASSERT(UT_SHOULD_NOT_HAPPEN); + break; } } - // - // TODO connect to jabber server and offer this document for - // collaboration - // - xmlFreeDoc(doc); } - -static bool s_handle_service_event(void* data) +// NOTE: _parseSessionFiles can be called from a thread other than our mainloop; +// Don't let access or modify any data from the mainloop! +void ServiceAccountHandler::_parseSessionFiles(soa::ArrayPtr files_array, GetSessionsResponseEvent& gsre) { - AbiCollabService* pService = AbiCollabService::getService(); - UT_return_val_if_fail(pService, false); - AbiCollab_ConnectionHandler* pHandler = pService->getConnectionHandler(); - if(pHandler == NULL) - { - return false; - } - UT_return_val_if_fail(pHandler, false); - - - if (pHandler->receive().size() > 0) + UT_return_if_fail(files_array); + + if (abicollab::FileArrayPtr files = files_array->construct()) { - for (std::list::iterator lpos = pHandler->receive().begin(); lpos != pHandler->receive().end(); ) + for (size_t i = 0; i < files->size(); i++) { - const AbiCollab_Packet_Data* pAPD = pHandler->receive().front(); - lpos = pHandler->receive().erase(lpos); - if (!pAPD) - { - UT_ASSERT(UT_SHOULD_NOT_HAPPEN); - break; - } - - // TODO: Check if this message really came from abiter@collaborate.abisource.com/AbiCollabService - // If not, we'll ignore it. We don't want people to flood us with fake content - // TODO: Don't hardcode the abiter/server/resource names - // TODO: there are more message types than this one :) - if (strcmp("abiter@collaborate.abisource.com/AbiCollabService", pAPD->buddy.utf8_str()) == 0) + if (abicollab::FilePtr file = files->operator[](i)) { - s_handle_service_message(pAPD); - } - else - { - // we've received a service message from someone other than the official - // arbiter; ignore it; - UT_DEBUGMSG(("Received message from |%s|, content |%s| \n",pAPD->buddy.utf8_str(), pAPD->packet.utf8_str())); - UT_DEBUGMSG(("Can't handle this!!!! \n")); - - UT_ASSERT(UT_SHOULD_NOT_HAPPEN); + UT_DEBUGMSG(("Got a file: %s (%s bytes, id: %s)\n", file->filename.c_str(), file->filesize.c_str(), file->doc_id.c_str())); + // NOTE: we can safely use the (unique) document id as the session identifier, + // as there is basically only one _ever lasting_ session for each + // document stored on abicollab.net + if (file->doc_id != "" && file->access == "readwrite") { + gsre.m_Sessions[file->doc_id.c_str()] = file->filename.c_str(); + } } } } - - return true; } -*/ + diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ServiceAccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ServiceAccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ServiceAccountHandler.h 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ServiceAccountHandler.h 2008-07-13 13:05:17.000000000 +0100 @@ -1,4 +1,5 @@ /* Copyright (C) 2006,2007 Marc Maurer + * Copyright (C) 2008 AbiSource Corporation B.V. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,22 +20,44 @@ #ifndef __SERVICEACCOUNTHANDLER__ #define __SERVICEACCOUNTHANDLER__ +#include +#include +#include #include +#include "xap_Types.h" #include "ut_string_class.h" - #include +#include "soa.h" +#include "AbiCollabSaveInterceptor.h" +#include "RealmBuddy.h" +#include "RealmConnection.h" +#include "RealmProtocol.h" +#include "AsioRealmProtocol.h" +#include "ServiceErrorCodes.h" + +namespace acs = abicollab::service; +namespace rpv1 = realm::protocolv1; class PD_Document; -typedef long long UT_sint64; +class GetSessionsResponseEvent; +class JoinSessionRequestResponseEvent; +class ServiceBuddy; extern AccountHandlerConstructor ServiceAccountHandlerConstructor; +typedef std::pair SessionBuddyPair; +typedef boost::shared_ptr > SessionBuddyPtr; + +#define SERVICE_ACCOUNT_HANDLER_TYPE "com.abisource.abiword.abicollab.backend.service" + class ServiceAccountHandler : public AccountHandler { public: ServiceAccountHandler(); virtual ~ServiceAccountHandler(); + static bool askPassword(const std::string& email, std::string& password); + // housekeeping virtual UT_UTF8String getDescription(); virtual UT_UTF8String getDisplayType(); @@ -42,6 +65,8 @@ // dialog management virtual void storeProperties(); + static XAP_Dialog_Id getDialogGenericInputId(); + static XAP_Dialog_Id getDialogGenericProgressId(); // connection management virtual ConnectResult connect(); @@ -55,16 +80,61 @@ // packet management virtual bool send(const Packet* packet); - virtual bool send(const Packet*, const Buddy& buddy); + virtual bool send(const Packet* packet, const Buddy& buddy); - // service specific functions - void updateDocumentsAsync(); - void saveDocumentAsync(UT_sint64 docId, PD_Document * pDoc); - void populateDocuments(const UT_UTF8String& packet); - void openDocumentAsync(UT_sint64 docId); - void closeDocument(UT_sint64 docId, PD_Document * pDoc); + // session management + virtual void getSessionsAsync(); + virtual void getSessionsAsync(const Buddy& buddy); + virtual bool hasSession(const UT_UTF8String& sSessionId); + virtual void joinSessionAsync(const Buddy& buddy, DocHandle& docHandle); + acs::SOAP_ERROR openDocument(UT_sint64 doc_id, UT_sint64 revision, const std::string& session_id, PD_Document** pDoc, XAP_Frame* pFrame); + UT_Error saveDocument(PD_Document* pDoc, const UT_UTF8String& sSessionId); + + // signal management + virtual void signal(const Event& event, const Buddy* pSource); + + static XAP_Dialog_Id m_iDialogGenericInput; + static XAP_Dialog_Id m_iDialogGenericProgress; + static AbiCollabSaveInterceptor m_saveInterceptor; private: + template + void _send(boost::shared_ptr packet, boost::shared_ptr recipient) + { + realm::protocolv1::send(*packet, recipient->connection().socket(), + boost::bind(&ServiceAccountHandler::_write_handler, this, + asio::placeholders::error, asio::placeholders::bytes_transferred, recipient, + boost::static_pointer_cast(packet))); + } + + void _write_handler(const asio::error_code& e, std::size_t bytes_transferred, + boost::shared_ptr recipient, boost::shared_ptr packet); + + acs::SOAP_ERROR _listDocuments(const std::string uri, const std::string email, const std::string password, + SessionBuddyPtr sessions_ptr); + void _listDocuments_cb(acs::SOAP_ERROR error, SessionBuddyPtr sessions_ptr); + + acs::SOAP_ERROR _openDocumentMaster(soa::CollectionPtr rcp, PD_Document** pDoc, XAP_Frame* pFrame, + const std::string& session_id, const std::string& filename); + acs::SOAP_ERROR _openDocumentSlave(ConnectionPtr connection, PD_Document** pDoc, XAP_Frame* pFrame, + const std::string& filename); + + void _handleJoinSessionRequestResponse( + JoinSessionRequestResponseEvent* jsre, Buddy* pBuddy, + XAP_Frame* pFrame, PD_Document** pDoc, const std::string& filename); + void _handleRealmPacket(RealmConnection& connection); + ConnectionPtr _getConnection(const std::string& session_id); + void _removeConnection(const std::string& session_id); + void _handleMessages(RealmConnection& connection); + void _parseSessionFiles(soa::ArrayPtr files_array, GetSessionsResponseEvent& gsre); + virtual void _handlePacket(Packet* packet, Buddy* buddy, bool autoAddBuddyOnJoin) + { AccountHandler::_handlePacket(packet, buddy, false); } + + + bool m_bOnline; // only used to determine if we are allowed to + // communicate with abicollab.net or not + std::vector m_connections; + std::string m_ssl_ca_file; }; #endif /* __SERVICEACCOUNTHANDLER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ServiceBuddy.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ServiceBuddy.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ServiceBuddy.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ServiceBuddy.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,67 @@ +/* Copyright (C) 2006,2007 Marc Maurer + * Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __SERVICEBUDDY__ +#define __SERVICEBUDDY__ + +#include "ut_string_class.h" +#include +#include + +class ServiceBuddy : public Buddy +{ +public: + ServiceBuddy(AccountHandler* handler, const UT_UTF8String& name) + : Buddy(handler, name) + { + setVolatile(true); + } + + virtual Buddy* clone() const { return new ServiceBuddy( *this ); } + + virtual UT_UTF8String getDescription() const + { + // TODO: append the group name or something like that + return getName(); + } + + virtual const DocTreeItem* getDocTreeItems() const + { + const vector& docHandles = getDocHandles(); + DocTreeItem* first = 0; + DocTreeItem* prev = 0; + for (vector::const_iterator pos = docHandles.begin(); pos != docHandles.end(); pos++) + { + DocTreeItem* item = new DocTreeItem(); + item->m_type = DOCTREEITEM_TYPE_DOCUMENT; + item->m_docHandle = *pos; + item->m_child = 0; + item->m_next = 0; + + if (!first) + first = item; + if (prev) + prev->m_next = item; + prev = item; + } + return first; + } +}; + +#endif /* __SERVICEBUDDY__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ServiceErrorCodes.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ServiceErrorCodes.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/ServiceErrorCodes.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/ServiceErrorCodes.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,64 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __SERVICE_ERRORCODES__ +#define __SERVICE_ERRORCODES__ + +#include +#include "soa.h" + +namespace abicollab { +namespace service { + +enum SOAP_ERROR +{ + // generic error (reserved) + SOAP_ERROR_OK = 0x00, + SOAP_ERROR_GENERIC = 0x01, + + // exception soap errors + SOAP_ERROR_GENERIC_EXCEPTION = 0x101, + SOAP_ERROR_DATABASE_EXCEPTION = 0x102, + + // abicollab soap errors + SOAP_ERROR_INVALID_PASSWORD = 0x201, + SOAP_ERROR_INVALID_EMAIL = 0x202 + // TODO: add more errors + + // saveDocument soap errors + // TODO: add more errors + + // openDocument soap errors + // TODO: add more errors +}; + +static SOAP_ERROR error(const soa::SoapFault& fault) +{ + if (!fault.string()) + return SOAP_ERROR_GENERIC; + try { + return static_cast(boost::lexical_cast(fault.string()->value())); + } catch (boost::bad_lexical_cast&) { + return SOAP_ERROR_GENERIC; + } +} + +} +} + +#endif /* __SERVICE_ERRORCODES__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/soa.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/soa.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/soa.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/soa.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,273 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __SOA__ +#define __SOA__ + +#include +#include +#include +#include +#include +#include "soa_types.h" +#include "soa_result.h" + +namespace soa { + +class function_arg { +public: + function_arg(const std::string& name, Type type) + : name_(name), + type_(type) + {} + + virtual ~function_arg() {} + + const std::string& name() const { + return name_; + } + + Type type() const { + return type_; + } + + // FIXME: returning an std::string is inefficient for large blocks of + // data; we should make it a boost::shared_ptr + virtual std::string str() const = 0; + +private: + std::string name_; + Type type_; +}; + +class function_arg_string : public function_arg { +public: + function_arg_string(const std::string& name, const std::string& value) + : function_arg(name, STRING_TYPE), + value_(value) + {} + + virtual std::string str() const { + return value_; + } + +private: + std::string value_; +}; + +class function_arg_int : public function_arg { +public: + function_arg_int(const std::string& name, int64_t value) + : function_arg(name, INT_TYPE), + value_(value) + {} + + virtual std::string str() const { + try { + return boost::lexical_cast(value_); + } catch (boost::bad_lexical_cast &) { + return "0"; + } + } + +private: + int64_t value_; +}; + +class function_arg_bool : public function_arg { +public: + function_arg_bool(const std::string& name, bool value) + : function_arg(name, BOOL_TYPE), + value_(value) + {} + + virtual std::string str() const { + return value_ ? "true" : "false"; + } + +private: + bool value_; +}; + +class function_arg_base64bin : public function_arg { +public: + function_arg_base64bin(Base64Bin value) + : function_arg(value.name(), BASE64BIN_TYPE), + value_(value) + {} + + virtual std::string str() const { + return value_.value(); + } + +private: + Base64Bin value_; +}; + +class function_call { +public: + function_call() {} + + function_call(const std::string& request, const std::string& response) + : request_(request), + response_(response) + {} + + function_call& operator()(std::string name, const char* value) { + args.push_back(boost::shared_ptr(new function_arg_string(name, value))); + return *this; + } + + function_call& operator()(std::string name, std::string value) { + args.push_back(boost::shared_ptr(new function_arg_string(name, value))); + return *this; + } + + function_call& operator()(std::string name, int64_t value) { + args.push_back(boost::shared_ptr(new function_arg_int(name, value))); + return *this; + } + + function_call& operator()(std::string name, bool value) { + args.push_back(boost::shared_ptr(new function_arg_bool(name, value))); + return *this; + } + + function_call& operator()(Base64Bin value) { + args.push_back(boost::shared_ptr(new function_arg_base64bin(value))); + return *this; + } + + const std::string& request() const { + return request_; + } + + const std::string& response() const { + return response_; + } + + void add_arg(boost::shared_ptr arg) { + args.push_back(arg); + } + + std::string str() const { + std::string ret; + // TODO: XML escape args/values + for (std::vector< boost::shared_ptr >::const_iterator cit = args.begin(); cit != args.end(); cit++) { + const function_arg& arg = **cit; + ret += "<" + arg.name() + " " + soap_type(arg.type()) + ">" + arg.str() + "\n"; + } + return ret; + } + +private: + std::string request_; + std::string response_; + std::vector< boost::shared_ptr > args; +}; + +class header { +public: + std::string str() const { + return ""; + } +}; + +class body { +public: + body(const std::string& ns_ref_) + : ns_ref(ns_ref_) + {} + + body(const std::string& ns_ref_, const function_call& fc) + : ns_ref(ns_ref_), + fc_(fc) + {} + + const function_call& function() const { + return fc_; + } + + void set_function(function_call fc) { + fc_ = fc; + } + + std::string str() const { + return "\n" \ + "<" + ns_ref + ":" + fc_.request() + ">\n" + + fc_.str() + + "\n" \ + "\n"; + } + +private: + std::string ns_ref; + function_call fc_; +}; + +class method_invocation { +public: + method_invocation(const std::string& custom_ns) + : custom_ns_(custom_ns), + custom_ns_ref_("nsref"), + body_(custom_ns_ref_) + {} + + method_invocation(const std::string& custom_ns, function_call fc) + : custom_ns_(custom_ns), + custom_ns_ref_("nsref"), + body_(custom_ns_ref_, fc) + {} + + const function_call& function() const { + return body_.function(); + } + + std::string str() const { + return "\n" \ + "\n" + + header_.str() + + body_.str() + + ""; + } + +private: + std::string default_namespaces() const { + return "xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"" \ + " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" \ + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" \ + " xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\""; + } + + std::string encoding_style() const { + return "SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\""; + } + + std::string input_name_; + std::string output_name_; + std::string custom_ns_; + std::string custom_ns_ref_; + header header_; + body body_; +}; +} + +#endif /* __SOA__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/soa_result.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/soa_result.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/soa_result.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/soa_result.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,271 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __SOA_RESULT__ +#define __SOA_RESULT__ + +#include +#include +#include "soa_types.h" +#include +#include + +namespace soa { + + static Type element_type(char* type) { + if (!type) + return COLLECTION_TYPE; // FIXME: well, just say it's a generic type for now + + const std::string& type_(type); + if (type_ == "xsd:string") + return STRING_TYPE; + if (type_ == "xsd:int") + return INT_TYPE; + if (type_ == "xsd:boolean") + return BOOL_TYPE; + if (type_ == "xsd:base64Binary") + return BASE64BIN_TYPE; + if (type_ == "xsd:QName") + return QNAME_TYPE; + if (type_ == "SOAP-ENC:Array") + return ARRAY_TYPE; + + return COLLECTION_TYPE; // FIXME: well, just say it's a generic type for now + } + + static std::string soap_type(Type type) { + switch (type) { + case STRING_TYPE: + return "xsi:type=\"xsd:string\""; + case INT_TYPE: + return "xsi:type=\"xsd:int\""; + case BOOL_TYPE: + return "xsi:type=\"xsd:boolean\""; + case BASE64BIN_TYPE: + return "xsi:type=\"xsd:base64Binary\""; + case QNAME_TYPE: + return "xsi:type=\"xsd:QName\""; + default: + // FIXME: should throw exception + return ""; + } + } + + static bool arg_value(const std::string& val, bool& b) { + if (val == "true" || val == "1") { + b = true; + return true; + } + if (val == "false" || val == "0") { + b = false; + return true; + } + return false; + } + + static bool arg_value(const std::string& val, int64_t& i) { + try { + i = boost::lexical_cast(val); + } catch (boost::bad_lexical_cast &) { + return false; + } + return true; + } + + // private class; should't be in the public api + class XmlDocDeleter { + public: + void operator()(xmlDocPtr* doc) { + // printf("Destructing xml doc ptr!\n"); + if (!doc || !*doc) + return; + xmlFreeDoc(*doc); + } + }; + + static GenericPtr parse_elements(xmlNode* element, GenericPtr parent) { + if (!element || element->type != XML_ELEMENT_NODE) + return parent; + + if (parent && !parent->complex()) { + //printf("ERROR: ADDING CHILD TO NON-COMPLEX TYPE!\n"); + return GenericPtr(); + } + + // parse this node + + char* type_str = reinterpret_cast(xmlGetProp(element, reinterpret_cast("type"))); + Type elem_type = element_type(type_str); + free(type_str); + + GenericPtr t; + switch (elem_type) { + case ARRAY_TYPE: + t.reset(new Array(reinterpret_cast(element->name))); + break; + case COLLECTION_TYPE: + t.reset(new Collection(reinterpret_cast(element->name))); + break; + case STRING_TYPE: + { + xmlChar* value = xmlNodeGetContent(element); + t.reset(new String(reinterpret_cast(element->name), reinterpret_cast(value))); + xmlFree(value); + } + break; + case INT_TYPE: + { + xmlChar* value = xmlNodeGetContent(element); + int64_t i; + if (arg_value(reinterpret_cast(value), i)) + t.reset(new Int(reinterpret_cast(element->name), i)); + xmlFree(value); + } + break; + case BOOL_TYPE: + { + xmlChar* value = xmlNodeGetContent(element); + bool b; + if (arg_value(reinterpret_cast(value), b)) + t.reset(new Bool(reinterpret_cast(element->name), b)); + xmlFree(value); + } + break; + case BASE64BIN_TYPE: + { + xmlChar* value = xmlNodeGetContent(element); + t.reset(new Base64Bin( + reinterpret_cast(element->name), + boost::shared_ptr(new std::string(reinterpret_cast(value))) + )); + xmlFree(value); + } + break; + case QNAME_TYPE: + { + xmlChar* value = xmlNodeGetContent(element); + t.reset(new QName(reinterpret_cast(element->name), reinterpret_cast(value))); + xmlFree(value); + } + break; + } + if (!t) { + return GenericPtr(); + } + + // parse the child nodes + if (t->complex()) { + for (xmlNode* child = element->children; child; child = child->next) { + parse_elements(child, t); + } + } + + // we have no parent; return what we found + if (!parent) { + return t; + } + + // attach the new element to the parent ellement + // FIXME: generalize + switch (parent->type()) { + case ARRAY_TYPE: + { + ArrayPtr a = parent->as< Array >(); + a->add(t); + } + break; + case COLLECTION_TYPE: + { + CollectionPtr c = parent->as(); + c->add(t); + } + break; + default: + // should not happen; + break; + } + + return parent; + } + + static GenericPtr parse_response(const std::string& response, const std::string& method_name) { + + // process the soap request + xmlDocPtr doc = xmlReadMemory(&response[0], response.size(), "noname.xml", NULL, 0); + if (!doc) { + return GenericPtr(); + } + + boost::shared_ptr reader(&doc, XmlDocDeleter()); + xmlNode* rootNode = xmlDocGetRootElement(*reader); + if (!rootNode) { + return GenericPtr(); + } + + if (strcasecmp(reinterpret_cast(rootNode->name), "Envelope") != 0) { + return GenericPtr(); + } + + for (xmlNode* soapNode = rootNode->children; soapNode; soapNode = soapNode->next) { + if (soapNode->type != XML_ELEMENT_NODE) + continue; + + if (strcasecmp(reinterpret_cast(soapNode->name), "Body") == 0) { + + for (xmlNode* methodNode = soapNode->children; methodNode; methodNode = methodNode->next) { + if (methodNode->type != XML_ELEMENT_NODE) + continue; + + if (strcasecmp(reinterpret_cast(methodNode->name), "Fault") == 0) { + GenericPtr soap_tree = parse_elements(methodNode, GenericPtr()); + if (!soap_tree) + throw SoapFault(); + + soa::CollectionPtr fault = boost::dynamic_pointer_cast(soap_tree); + if (!fault) + throw SoapFault(); + + throw SoapFault(fault->get("faultcode"), + fault->get("faultstring"), + fault->get("detail")); + } + + if (method_name != reinterpret_cast(methodNode->name)) + continue; + + for (xmlNode* child = methodNode->children; child; child = child->next) { + GenericPtr soap_tree = parse_elements(child, GenericPtr()); + if (soap_tree) // FIXME: are we right in assuming there is only 1 response element? + return soap_tree; + } + + return GenericPtr(); + } + } else if (strcasecmp(reinterpret_cast(soapNode->name), "Header") == 0) { + return GenericPtr(); + } + else { + return GenericPtr(); + } + } + return GenericPtr(); + } + +} + +#endif /* __SOA_RESULT__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/soa_soup.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/soa_soup.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/soa_soup.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/soa_soup.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,202 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __SOA_SOUP__ +#define __SOA_SOUP__ + +#include +#include +#include +#include +#include +#include +#include + +namespace soup_soa { + + /* public types */ + + struct SoaSoupSession + { + SoaSoupSession(SoupMessage* msg, const std::string& ssl_ca_file) + : m_session(NULL), + m_msg(msg), + progress_cb_ptr(), + received_content_length(0) + { + _set_session(ssl_ca_file); + } + + SoaSoupSession(SoupMessage* msg, const std::string& ssl_ca_file, boost::function progress_cb_) + : m_session(NULL), + m_msg(msg), + progress_cb_ptr(new boost::function(progress_cb_)), + received_content_length(0) + { + _set_session(ssl_ca_file); + } + + ~SoaSoupSession() { + if (m_session) + g_object_unref(m_session); + if (m_msg) + g_object_unref(m_msg); + } + + void callback(uint32_t progress) { + if (!progress_cb_ptr) + return; + (*progress_cb_ptr)(m_session, m_msg, progress); + } + + SoupSession* m_session; + SoupMessage* m_msg; + boost::shared_ptr > progress_cb_ptr; + uint32_t received_content_length; + + private: + void _set_session(const std::string& ssl_ca_file) { + m_session = + ssl_ca_file.size() == 0 + ? soup_session_sync_new_with_options(NULL) + : soup_session_sync_new_with_options( + SOUP_SESSION_SSL_CA_FILE, ssl_ca_file.c_str(), + /* TODO: add user agent */ + NULL + ); + } + + }; + + /* private function prototypes */ + +#ifdef SOUP24 + static void _got_chunk_cb(SoupMessage* msg, SoupBuffer *chunk, SoaSoupSession* progress_info); +#else + static void _got_chunk_cb(SoupMessage *msg, SoaSoupSession* user_data); +#endif + static soa::GenericPtr _invoke(const std::string& url, const soa::method_invocation& mi, SoaSoupSession& sess); + + /* public functions */ + + soa::GenericPtr invoke(const std::string& url, const soa::method_invocation& mi, const std::string& ssl_ca_file) { + std::string soap_msg = mi.str(); + UT_DEBUGMSG(("SOAP Request: %s\n", soap_msg.c_str())); + SoupMessage* msg = soup_message_new ("POST", url.c_str()); +#ifdef SOUP24 + soup_message_set_request(msg, "text/xml", SOUP_MEMORY_STATIC, &soap_msg[0], soap_msg.size()); +#else + soup_message_set_request(msg, "text/xml", SOUP_BUFFER_USER_OWNED, &soap_msg[0], soap_msg.size()); +#endif + SoaSoupSession sess(msg, ssl_ca_file); + return _invoke(url, mi, sess); + } + + soa::GenericPtr invoke(const std::string& url, const soa::method_invocation& mi, const std::string& ssl_ca_file, + boost::function progress_cb) { + std::string soap_msg = mi.str(); + UT_DEBUGMSG(("SOAP Request: %s\n", soap_msg.c_str())); + SoupMessage* msg = soup_message_new ("POST", url.c_str()); + SoaSoupSession sess(msg, ssl_ca_file, progress_cb); + g_signal_connect(G_OBJECT (msg), "got-chunk", G_CALLBACK(_got_chunk_cb), (gpointer)(&sess)); +#ifdef SOUP24 + soup_message_set_request(msg, "text/xml", SOUP_MEMORY_STATIC, &soap_msg[0], soap_msg.size()); +#else + soup_message_set_request(msg, "text/xml", SOUP_BUFFER_USER_OWNED, &soap_msg[0], soap_msg.size()); +#endif + return _invoke(url, mi, sess); + } + + /* private functions */ + + static soa::GenericPtr _invoke(const std::string& url, const soa::method_invocation& mi, SoaSoupSession& sess) { + if (!sess.m_session || !sess.m_msg ) + return soa::GenericPtr(); + + guint status = soup_session_send_message (sess.m_session, sess.m_msg); + if (!(SOUP_STATUS_IS_SUCCESSFUL (status) || + status == SOUP_STATUS_INTERNAL_SERVER_ERROR /* used for SOAP Faults */)) + { + UT_DEBUGMSG(("Error executing SOAP call: %s\n", sess.m_msg->reason_phrase)); + return soa::GenericPtr(); + } + + // store the SOAP result in a string + // FIXME: ineffecient copy + std::string result; +#ifdef SOUP24 + if (!sess.m_msg->response_body || !sess.m_msg->response_body->data) + return soa::GenericPtr(); + result.resize(sess.m_msg->response_body->length); + std::copy(sess.m_msg->response_body->data, sess.m_msg->response_body->data+sess.m_msg->response_body->length, result.begin()); +#else + result.resize(sess.m_msg->response.length); + std::copy(sess.m_msg->response.body, sess.m_msg->response.body+sess.m_msg->response.length, result.begin()); +#endif + UT_DEBUGMSG(("SOAP Response: %s\n", result.c_str())); + return soa::parse_response(result, mi.function().response()); + } + +#ifdef SOUP24 + static void _got_chunk_cb(SoupMessage* msg, SoupBuffer *chunk, SoaSoupSession* progress_info) +#else + static void _got_chunk_cb(SoupMessage* msg, SoaSoupSession* progress_info) +#endif + { + UT_return_if_fail(msg && msg->response_headers); + if (!progress_info) + return; + + uint32_t content_length = 0; +#ifdef SOUP24 + content_length = (uint32_t)soup_message_headers_get_content_length(msg->response_headers); +#else + const char* content_length_str = soup_message_get_header(msg->response_headers, "Content-Length"); + if (!content_length_str) + return; + + try + { + content_length = boost::lexical_cast(content_length_str); + } + catch (boost::bad_lexical_cast &) + { + UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); // unless the server is really broken + return; + } +#endif + + if (content_length == 0) + return; + +#ifdef SOUP24 + if (!msg->response_body) + return; + progress_info->received_content_length = msg->response_body->length; +#else + progress_info->received_content_length += msg->response.length; +#endif + uint32_t progress = (uint32_t)(((float)progress_info->received_content_length / content_length)*100); + if (progress > 100) + progress = 100; + progress_info->callback(progress); + } + +} + +#endif /* __SOA_SOUP__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/soa_types.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/soa_types.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/service/xp/soa_types.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/service/xp/soa_types.h 2008-07-13 13:05:17.000000000 +0100 @@ -0,0 +1,242 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __SOA_TYPES__ +#define __SOA_TYPES__ + +#include +#include +#include +#include + +namespace soa { + +enum Type { + ARRAY_TYPE = 0, + COLLECTION_TYPE, + STRING_TYPE, + INT_TYPE, + BOOL_TYPE, + BASE64BIN_TYPE, + QNAME_TYPE +}; + +class Generic : public boost::enable_shared_from_this { +public: + Generic(const std::string& name, Type type) + : name_(name), + type_(type) + {} + + virtual ~Generic() { + } + + virtual bool complex() { + return false; + } + + const std::string& name() const { + return name_; + } + + const Type type() const { + return type_; + } + + template + boost::shared_ptr as() { + return boost::dynamic_pointer_cast(shared_from_this()); + } + + template + boost::shared_ptr as(const std::string& name) { + if (name_ != name) + return boost::shared_ptr(); + return boost::dynamic_pointer_cast(shared_from_this()); + } + +private: + std::string name_; + Type type_; +}; +typedef boost::shared_ptr GenericPtr; + +template +class Primitive : public Generic { +public: + Primitive(const std::string& name, T t) + : Generic(name, Y), + value_(t) + {} + + const T& value() const { + return value_; + } + +private: + T value_; +}; + +typedef Primitive String; +typedef boost::shared_ptr StringPtr; + +typedef Primitive Int; +typedef boost::shared_ptr IntPtr; + +typedef Primitive Bool; +typedef boost::shared_ptr BoolPtr; + +class Base64Bin : public Generic { +public: + Base64Bin(const std::string& name, boost::shared_ptr data) + : Generic(name, BASE64BIN_TYPE), + m_data(data) + {} + + const std::string& value() const { + return *m_data; + } + +private: + boost::shared_ptr m_data; +}; +typedef boost::shared_ptr Base64BinPtr; + +typedef Primitive QName; // FIXME: QName's are not simple strings, but they have a Namespace URI, local part and prefix +typedef boost::shared_ptr QNamePtr; + +class Complex : public Generic { +public: + Complex(const std::string& name, Type t) + : Generic(name, t) + {} + + virtual bool complex() { + return true; + } +}; + +template +class Array : public Complex { +public: + Array(const std::string& name) + : Complex(name, ARRAY_TYPE) + {} + + size_t size() const { + return values_.size(); + } + + template + boost::shared_ptr< Array< boost::shared_ptr > > construct() const { + boost::shared_ptr< Array< boost::shared_ptr > > conv(new Array< boost::shared_ptr >(name())); + for (typename std::vector< T >::const_iterator it = values_.begin(); it != values_.end(); it++) { + conv->add(Y::construct(*it)); + } + return conv; + } + + T get(size_t i) { + return values_[i]; + } + + T operator[](size_t i) { + return values_[i]; + } + + virtual void add(T element) { + values_.push_back(element); + } + +private: + std::vector< T > values_; +}; +typedef boost::shared_ptr< Array > ArrayPtr; + +class Collection : public Complex { +public: + Collection(const std::string& name) + : Complex(name, COLLECTION_TYPE) + {} + + // TODO: back this by a multimap + + size_t size() const { + return values_.size(); + } + + template + boost::shared_ptr get(const std::string& name) { + for (std::vector::iterator it = values_.begin(); it != values_.end(); it++) { + if ((*it)->name() == name) { + return (*it)->as(); + } + } + return boost::shared_ptr(); + } + + template + boost::shared_ptr operator[](const std::string& name) { + return get(name); + } + + virtual void add(GenericPtr element) { + values_.push_back(element); + } + + std::vector& values() { + return values_; + } + +private: + std::vector values_; +}; +typedef boost::shared_ptr CollectionPtr; + +class SoapFault { +public: + SoapFault() + : code_(), string_(), detail_() { + } + + SoapFault(QNamePtr code, StringPtr string, StringPtr detail) + : code_(code), string_(string), detail_(detail) { + } + + QNamePtr code() const { + return code_; + } + + StringPtr string() const { + return string_; + } + + StringPtr detail() const { + return detail_; + } + +private: + QNamePtr code_; + StringPtr string_; + // TODO: add faultactor actor_; + StringPtr detail_; +}; + +} + +#endif /* __SOA_TYPES__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/GNUmakefile.in 2008-04-06 22:37:37.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/GNUmakefile.in 2008-07-13 14:09:56.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/unix/GNUmakefile.in 2008-04-06 22:37:37.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/unix/GNUmakefile.in 2008-07-13 14:09:56.000000000 +0100 @@ -89,6 +89,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarBuddy.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarBuddy.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarBuddy.h 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarBuddy.h 2008-07-13 13:05:18.000000000 +0100 @@ -27,7 +27,7 @@ class DocHandle; -ABI_EXPORT class SugarBuddy : public Buddy + class SugarBuddy : public Buddy { public: SugarBuddy(AccountHandler* handler, const UT_UTF8String& name, const UT_UTF8String dbusName) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarUnixAccountHandler.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarUnixAccountHandler.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarUnixAccountHandler.cpp 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarUnixAccountHandler.cpp 2008-07-13 13:05:18.000000000 +0100 @@ -285,7 +285,7 @@ pManager->registerEventListener(this); // start hosting a session on the current document UT_UTF8String sID; - pManager->startSession(pDoc, sID); + pManager->startSession(pDoc, sID, NULL); return true; } else diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarUnixAccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarUnixAccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarUnixAccountHandler.h 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/sugar/unix/SugarUnixAccountHandler.h 2008-07-13 13:05:18.000000000 +0100 @@ -33,7 +33,7 @@ class Session; class FV_View; -class ABI_EXPORT SugarAccountHandler : public AccountHandler +class SugarAccountHandler : public AccountHandler { public: static SugarAccountHandler* getHandler(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/GNUmakefile.in 2008-04-06 22:37:37.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/GNUmakefile.in 2008-07-13 14:09:57.000000000 +0100 @@ -66,6 +66,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/Makefile 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/Makefile 2008-07-13 13:05:20.000000000 +0100 @@ -26,7 +26,7 @@ TARGETS= $(OBJS) -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/unix/GNUmakefile.in 2008-04-06 22:37:37.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/unix/GNUmakefile.in 2008-07-13 14:09:57.000000000 +0100 @@ -88,6 +88,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/unix/TCPUnixAccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/unix/TCPUnixAccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/unix/TCPUnixAccountHandler.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/unix/TCPUnixAccountHandler.h 2008-07-13 13:05:19.000000000 +0100 @@ -21,7 +21,7 @@ #include -class ABI_EXPORT TCPUnixAccountHandler : public TCPAccountHandler +class TCPUnixAccountHandler : public TCPAccountHandler { public: TCPUnixAccountHandler(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/win/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/win/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/win/GNUmakefile.in 2008-04-06 22:37:37.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/win/GNUmakefile.in 2008-07-13 14:09:57.000000000 +0100 @@ -88,6 +88,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/win/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/win/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/win/Makefile 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/win/Makefile 2008-07-13 13:05:20.000000000 +0100 @@ -32,7 +32,7 @@ -I$(ABI_ROOT)/../libs/boost \ -I$(ABI_ROOT)/../libs/asio/include -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/win/TCPWin32AccountHandler.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/win/TCPWin32AccountHandler.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/win/TCPWin32AccountHandler.cpp 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/win/TCPWin32AccountHandler.cpp 2008-07-13 13:05:20.000000000 +0100 @@ -20,6 +20,15 @@ #include #include "TCPWin32AccountHandler.h" +#define ABI_RID_DIALOG_COLLABTCP_SERVERENTRY 201 +#define ABI_RID_DIALOG_COLLABTCP_PORTENTRY 202 +#define ABI_RID_DIALOG_COLLABTCP_SERVERLABEL 203 +#define ABI_RID_DIALOG_COLLABTCP_PORTLABEL 204 +#define ABI_RID_DIALOG_COLLABTCP_SERVERRADIO 205 +#define ABI_RID_DIALOG_COLLABTCP_JOINRADIO 206 +#define ABI_RID_DIALOG_COLLABTCP_AUTOCONNECTCHECK 207 +#define ABI_RID_DIALOG_COLLABTCP_USESECURECHECK 208 + AccountHandlerConstructor TCPAccountHandlerConstructor = &TCPWin32AccountHandler::static_constructor; AccountHandler * TCPWin32AccountHandler::static_constructor() @@ -27,12 +36,10 @@ return static_cast(new TCPWin32AccountHandler()); } - +// return true if we process the command, false otherwise BOOL TCPWin32AccountHandler::_onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { - WORD wNotifyCode = HIWORD(wParam); WORD wId = LOWORD(wParam); - HWND hWndCtrl = (HWND)lParam; bool serve = _isCheckedHwnd(m_hServerRadio); AP_Win32Dialog_CollaborationAddAccount * pThis; @@ -55,13 +62,13 @@ // enable the address entry EnableWindow(m_hServerEntry, true); } - + return true; case ABI_RID_DIALOG_COLLABTCP_SERVERENTRY: case ABI_RID_DIALOG_COLLABTCP_PORTENTRY: // These have the ability to enable or disable the "OK" button - pThis=(AP_Win32Dialog_CollaborationAddAccount *)GetWindowLong(m_hParentDlg,DWL_USER); + pThis = (AP_Win32Dialog_CollaborationAddAccount *)GetWindowLong(m_hParentDlg,DWL_USER); // note: GetWindowTextLength may have a Unicode caveat, according to MSDN // It may return a value higher than the actual length. This is probably OK for @@ -96,21 +103,18 @@ // we have no port - disable the OK button! pThis->setBackendValidity(false); } - break; - - - + return true; default: - // unhandled: return 1 - return 1; + return false; } } TCPWin32AccountHandler::TCPWin32AccountHandler() : TCPAccountHandler(), - m_hBox(NULL), + m_pWin32Dialog(NULL), + m_hInstance(NULL), m_hServerEntry(NULL), m_hPortEntry(NULL), m_hServerRadio(NULL), @@ -119,163 +123,108 @@ m_hPortLabel(NULL), m_hAutoconnectCheck(NULL), m_hUseSecureCheck(NULL), - m_hInstance(NULL), - m_hParentDlg(NULL), - m_bEmbedded(false), - p_win32Dialog(NULL) + m_hParentDlg(NULL) { - AbiCollabSessionManager * pSessionManager= AbiCollabSessionManager::getManager(); + AbiCollabSessionManager * pSessionManager = AbiCollabSessionManager::getManager(); if (pSessionManager) { - m_hInstance=pSessionManager->getInstance(); + m_hInstance = pSessionManager->getInstance(); } - } void TCPWin32AccountHandler::embedDialogWidgets(void* pEmbeddingParent) { UT_DEBUGMSG(("TCPWin32AccountHandler::embedDialogWidgets()\n")); UT_return_if_fail(pEmbeddingParent); - m_hBox=pEmbeddingParent; - if (m_bEmbedded) - { - // if already embedded, remove first. - removeDialogWidgets(pEmbeddingParent); - } - - - - HWND hParentDlg=GetParent(m_hBox); - UT_return_if_fail(hParentDlg); - - AP_Win32Dialog_CollaborationAddAccount * pThis=(AP_Win32Dialog_CollaborationAddAccount *)GetWindowLong(m_hParentDlg,DWL_USER); - - // Get a DialogHelper - /* - if (p_win32Dialog) - { - delete p_win32Dialog; - } - p_win32Dialog = new XAP_Win32DialogHelper(hParentDlg); - */ - + + // our enclosing window must be a HWND + HWND hBox = reinterpret_cast(pEmbeddingParent); /* Non-Tabbable Labels */ // "Address:" m_hServerLabel = CreateWindowEx(WS_EX_NOPARENTNOTIFY, "STATIC", "Address:", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, - 15, 55, 51, 15, m_hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_SERVERLABEL, m_hInstance, (LPARAM) pThis); + 15, 57, 51, 15, hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_SERVERLABEL, m_hInstance, 0); UT_return_if_fail(m_hServerLabel); // "Port:" m_hPortLabel = CreateWindowEx(WS_EX_NOPARENTNOTIFY, "STATIC", "Port:", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, - 15, 75, 47, 15, m_hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_PORTLABEL, m_hInstance, (LPARAM) pThis); + 15, 87, 47, 15, hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_PORTLABEL, m_hInstance, 0); UT_return_if_fail(m_hPortLabel); /* Radio Button Group */ // Act As Server radio button m_hServerRadio = CreateWindowEx(WS_EX_NOPARENTNOTIFY | WS_EX_TRANSPARENT, "BUTTON", "Accept Incoming Connections", BS_NOTIFY | BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE |WS_GROUP|WS_TABSTOP, - 15, 15, 200, 15, m_hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_SERVERRADIO, m_hInstance, (LPARAM) pThis); + 15, 15, 200, 15, hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_SERVERRADIO, m_hInstance, 0); UT_return_if_fail(m_hServerRadio); // Join a Server radio button m_hJoinRadio = CreateWindowEx(WS_EX_NOPARENTNOTIFY | WS_EX_TRANSPARENT, "BUTTON", "Connect to Another Computer", BS_NOTIFY | BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, - 15, 35, 200, 15, m_hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_JOINRADIO, m_hInstance, (LPARAM) pThis); + 15, 35, 200, 15, hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_JOINRADIO, m_hInstance, 0); UT_return_if_fail(m_hJoinRadio); /* Tabbable */ // Entry box for IP address of server // should be disabled when in server mode, and OK should be disabled when this is empty in join mode - m_hServerEntry = CreateWindowEx(WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE, "EDIT", "", ES_LEFT | WS_CHILD | WS_BORDER | WS_VISIBLE | WS_TABSTOP | WS_GROUP, - 80, 55, 121, 20, m_hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_SERVERENTRY, m_hInstance, (LPARAM) pThis); + m_hServerEntry = CreateWindowEx(WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE, "EDIT", "", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_BORDER | WS_VISIBLE | WS_TABSTOP | WS_GROUP, + 80, 55, 121, 20, hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_SERVERENTRY, m_hInstance, 0); UT_return_if_fail(m_hServerEntry); // Port entry box // OK should be disabled when this is empty m_hPortEntry = CreateWindowEx(WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE, "EDIT", boost::lexical_cast(DEFAULT_TCP_PORT).c_str(), ES_LEFT | WS_CHILD | WS_BORDER | WS_VISIBLE | WS_TABSTOP| WS_GROUP, - 80, 85, 60, 20, m_hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_PORTENTRY, m_hInstance, (LPARAM) pThis); + 80, 85, 60, 20, hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_PORTENTRY, m_hInstance, 0); UT_return_if_fail(m_hPortEntry); // Checkbox for future secure support - currently disabled m_hUseSecureCheck = CreateWindowEx(WS_EX_NOPARENTNOTIFY, "BUTTON", "Use Secure Connection", BS_CHECKBOX | BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP | WS_GROUP, - 14, 115, 174, 15, m_hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_USESECURECHECK, m_hInstance, (LPARAM) pThis); + 14, 115, 174, 15, hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_USESECURECHECK, m_hInstance, 0); UT_return_if_fail(m_hUseSecureCheck); // Checkbox for Connect on Startup m_hAutoconnectCheck = CreateWindowEx(WS_EX_NOPARENTNOTIFY, "BUTTON", "Connect Automatically", BS_CHECKBOX | BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_GROUP, - 14, 135, 172, 15 , m_hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_AUTOCONNECTCHECK, m_hInstance, (LPARAM) pThis); + 14, 135, 172, 15 , hBox, (HMENU) ABI_RID_DIALOG_COLLABTCP_AUTOCONNECTCHECK, m_hInstance, 0); UT_return_if_fail(m_hAutoconnectCheck); - - // Font setting code borrowed from XAP_Win32Dlg_About - LOGFONT lf = { 0 }; strcpy(lf.lfFaceName, "MS Sans Serif"); - lf.lfHeight = 12; lf.lfWeight = 0; HFONT hfontPrimary = CreateFontIndirect(&lf); - HWND rgFontReceivers[] = { m_hServerRadio, m_hJoinRadio, m_hServerLabel, m_hPortLabel, m_hServerEntry, m_hPortEntry, m_hAutoconnectCheck, m_hUseSecureCheck}; - - for (int iWnd = 0; iWnd < G_N_ELEMENTS(rgFontReceivers); ++iWnd) - { + for (UT_uint32 iWnd = 0; iWnd < G_N_ELEMENTS(rgFontReceivers); iWnd++) SendMessage(rgFontReceivers[iWnd], WM_SETFONT, (WPARAM) hfontPrimary, 0); - } - // default to join - _checkButtonHwnd(m_hJoinRadio, true); + // default to serve + _checkButtonHwnd(m_hServerRadio, true); // default to autoconnect _checkButtonHwnd(m_hAutoconnectCheck, true); - } +#define DESTROY_WINDOW(M) if (M) { UT_ASSERT_HARMLESS(DestroyWindow(M)); M = 0; } + void TCPWin32AccountHandler::removeDialogWidgets(void* pEmbeddingParent) { UT_DEBUGMSG(("TCPAccountHandler::removeDialogWidgets()\n")); - if (m_hServerEntry) - { - UT_ASSERT(DestroyWindow(m_hServerEntry)); - } - - if (m_hPortEntry) - { - UT_ASSERT(DestroyWindow(m_hPortEntry)); - } - - if (m_hServerLabel) - { - UT_ASSERT(DestroyWindow(m_hServerLabel)); - } - - if (m_hPortLabel) - { - UT_ASSERT(DestroyWindow(m_hPortLabel)); - } - - if (m_hServerRadio) - { - UT_ASSERT(DestroyWindow(m_hServerRadio)); - } - - if (m_hJoinRadio) - { - UT_ASSERT(DestroyWindow(m_hJoinRadio)); - } + UT_return_if_fail(pEmbeddingParent); + + // our enclosing window must be a HWND + HWND hBox = reinterpret_cast(pEmbeddingParent); - if (m_hAutoconnectCheck) - { - UT_ASSERT(DestroyWindow(m_hAutoconnectCheck)); - } + DESTROY_WINDOW(m_hServerEntry); + DESTROY_WINDOW(m_hPortEntry); + DESTROY_WINDOW(m_hServerLabel); + DESTROY_WINDOW(m_hPortLabel); + DESTROY_WINDOW(m_hServerRadio); + DESTROY_WINDOW(m_hJoinRadio); + DESTROY_WINDOW(m_hAutoconnectCheck); + DESTROY_WINDOW(m_hUseSecureCheck); - if (m_hUseSecureCheck) - { - UT_ASSERT(DestroyWindow(m_hUseSecureCheck)); - } - /* boom! */ + // destroying a window does not repaint the area it owned, so do it here + RedrawWindow(GetParent(hBox), NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW); } void TCPWin32AccountHandler::storeProperties() @@ -325,18 +274,12 @@ UT_return_if_fail(hCtrl); SendMessage(hCtrl, BM_SETCHECK, bChecked ? BST_CHECKED : BST_UNCHECKED, 0); } + bool TCPWin32AccountHandler::_isCheckedHwnd(HWND hCtrl) { // note - does not work for 3-state buttons, obviously, since it returns a bool UT_return_val_if_fail(hCtrl, false); - if (SendMessage(hCtrl, BM_GETCHECK, 0, 0)==BST_CHECKED) - { - return true; - } - else - { - return false; - } + return (SendMessage(hCtrl, BM_GETCHECK, 0, 0) == BST_CHECKED); } int TCPWin32AccountHandler::_getControlTextHwnd(HWND hCtrl, int iLen, const char * p_szBuf) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/win/TCPWin32AccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/win/TCPWin32AccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/win/TCPWin32AccountHandler.h 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/win/TCPWin32AccountHandler.h 2008-07-13 13:05:20.000000000 +0100 @@ -29,17 +29,7 @@ #include -#define ABI_RID_DIALOG_COLLABTCP_SERVERENTRY 201 -#define ABI_RID_DIALOG_COLLABTCP_PORTENTRY 202 -#define ABI_RID_DIALOG_COLLABTCP_SERVERLABEL 203 -#define ABI_RID_DIALOG_COLLABTCP_PORTLABEL 204 -#define ABI_RID_DIALOG_COLLABTCP_SERVERRADIO 205 -#define ABI_RID_DIALOG_COLLABTCP_JOINRADIO 206 -#define ABI_RID_DIALOG_COLLABTCP_AUTOCONNECTCHECK 207 -#define ABI_RID_DIALOG_COLLABTCP_USESECURECHECK 208 - - -class ABI_EXPORT TCPWin32AccountHandler : public TCPAccountHandler +class TCPWin32AccountHandler : public TCPAccountHandler { public: TCPWin32AccountHandler(); @@ -53,13 +43,10 @@ BOOL _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam); private: - XAP_Win32DialogHelper * p_win32Dialog; - - bool m_bEmbedded; + XAP_Win32DialogHelper * m_pWin32Dialog; // handles HINSTANCE m_hInstance; - HWND m_hBox; HWND m_hServerEntry; HWND m_hPortEntry; HWND m_hServerRadio; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/GNUmakefile.am /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/GNUmakefile.am --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/GNUmakefile.am 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/GNUmakefile.am 2008-07-13 13:05:20.000000000 +0100 @@ -12,12 +12,8 @@ LDFLAGS = @LDFLAGS@ @ABICOLLAB_TCP_LIBS@ @PLATFORM_LDFLAGS@ noinst_LTLIBRARIES = libAbiCollabTCPHandler.la -libAbiCollabTCPHandler_la_SOURCES = IOClientHandler.h \ - IOHandler.h \ - IOServerHandler.h \ +libAbiCollabTCPHandler_la_SOURCES = IOServerHandler.h \ Session.h \ - Synchronizer.cpp \ - Synchronizer.h \ TCPAccountHandler.cpp \ TCPAccountHandler.h \ TCPBuddy.h diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/GNUmakefile.in 2008-04-06 22:37:37.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/GNUmakefile.in 2008-07-13 14:09:58.000000000 +0100 @@ -50,8 +50,7 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libAbiCollabTCPHandler_la_DEPENDENCIES = \ ../unix/libAbiCollabTCPUnixHandler.la -am_libAbiCollabTCPHandler_la_OBJECTS = Synchronizer.lo \ - TCPAccountHandler.lo +am_libAbiCollabTCPHandler_la_OBJECTS = TCPAccountHandler.lo libAbiCollabTCPHandler_la_OBJECTS = \ $(am_libAbiCollabTCPHandler_la_OBJECTS) libAbiCollabTCPHandler_la_LINK = $(LIBTOOL) --tag=CXX \ @@ -90,6 +89,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ @@ -327,12 +328,8 @@ Makefile noinst_LTLIBRARIES = libAbiCollabTCPHandler.la -libAbiCollabTCPHandler_la_SOURCES = IOClientHandler.h \ - IOHandler.h \ - IOServerHandler.h \ +libAbiCollabTCPHandler_la_SOURCES = IOServerHandler.h \ Session.h \ - Synchronizer.cpp \ - Synchronizer.h \ TCPAccountHandler.cpp \ TCPAccountHandler.h \ TCPBuddy.h @@ -390,7 +387,6 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Synchronizer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TCPAccountHandler.Plo@am__quote@ .cpp.o: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/IOClientHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/IOClientHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/IOClientHandler.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/IOClientHandler.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,85 +0,0 @@ -/* Copyright (C) 2007 by Marc Maurer - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef __IO_CLIENT_HANDLER__ -#define __IO_CLIENT_HANDLER__ - -#include -#include - -#include "Synchronizer.h" -#include "Session.h" -#include "IOHandler.h" - -class IOClientHandler : public IOHandler -{ -public: - IOClientHandler(std::string hostname, std::string port) - : io_service(), - thread(NULL), - work(NULL), - resolver(io_service), - query(hostname.c_str(), port.c_str()) - { - } - - virtual ~IOClientHandler() - { - UT_DEBUGMSG(("IOClientHandler::~IOClientHandler\n")); - } - - virtual void stop() - { - UT_DEBUGMSG(("IOClientHandler::stop()\n")); - DELETEP(work); - io_service.stop(); - if (thread) - { - thread->join(); - DELETEP(thread); - } - UT_DEBUGMSG(("IOClientHandler stopped\n")); - } - - Session* constructSession(void (*ef)(Session*), TCPAccountHandler& handler) - { - return new Session(io_service, ef, handler); - } - - void connect(Session& session) - { - UT_return_if_fail(work == NULL); - - work = new asio::io_service::work(io_service); - thread = new asio::thread(boost::bind(&asio::io_service::run, &io_service)); - - // TODO: catch exceptions - asio::ip::tcp::resolver::iterator iterator(resolver.resolve(query)); - session.getSocket().connect(*iterator); - session.asyncReadHeader(); - } - -private: - asio::io_service io_service; - asio::thread* thread; - asio::io_service::work* work; - asio::ip::tcp::resolver resolver; - asio::ip::tcp::resolver::query query; -}; - -#endif /* __IO_CLIENT_HANDLER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/IOHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/IOHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/IOHandler.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/IOHandler.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,36 +0,0 @@ -/* Copyright (C) 2007 by Marc Maurer - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef __IO_HANDLER__ -#define __IO_HANDLER__ - -class Session; -class IOServerHandler; - -class IOHandler -{ -public: - virtual ~IOHandler() {} - - virtual void stop() = 0; - -// virtual void asyncWrite(int size, const char* data) = 0; -// virtual bool isConnected() = 0; -}; - -#endif /* __IO_HANDLER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/IOServerHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/IOServerHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/IOServerHandler.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/IOServerHandler.h 2008-07-13 13:05:20.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2007 by Marc Maurer +/* Copyright (C) 2007-2008 by Marc Maurer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -22,109 +22,92 @@ #include "ut_debugmsg.h" #include +#include #include -#include "Synchronizer.h" +#include #include "Session.h" -#include "IOHandler.h" class TCPAccountHandler; using asio::ip::tcp; -class IOServerHandler : public IOHandler +class IOServerHandler { public: - IOServerHandler(int port, void (*af)(IOServerHandler*), TCPAccountHandler& handler) - : accept_synchronizer((void (*)(void*))af, (void*)this), - io_service(), - work(NULL), - thread(NULL), + IOServerHandler(int port, boost::function)> af, + boost::function ef, asio::io_service& io_service_) + : accept_synchronizer(boost::bind(&IOServerHandler::_signal, this)), + io_service(io_service_), m_pAcceptor(NULL), - m_handler(handler) + session_ptr(), + m_af(af), + m_ef(ef) { - UT_DEBUGMSG(("IOServerHandler()\n")); - work = new asio::io_service::work(io_service); - m_pAcceptor = new tcp::acceptor(io_service, tcp::endpoint(tcp::v4(), port)); - thread = new asio::thread(boost::bind(&asio::io_service::run, &io_service)); + UT_DEBUGMSG(("IOServerHandler()\n")); + m_pAcceptor = new tcp::acceptor(io_service, tcp::endpoint(tcp::v4(), port)); } virtual ~IOServerHandler() { UT_DEBUGMSG(("IOServerHandler::~IOServerHandler()\n")); - if (m_pAcceptor) - stop(); + if (m_pAcceptor) + stop(); } virtual void stop() { - UT_DEBUGMSG(("IOServerHandler::stop()\n")); + UT_DEBUGMSG(("IOServerHandler::stop()\n")); if (m_pAcceptor) { m_pAcceptor->close(); DELETEP(m_pAcceptor); } - DELETEP(work); - io_service.stop(); - if (thread) - thread->join(); - DELETEP(thread); } - - void run(Session& newSession) + + void run() { UT_DEBUGMSG(("IOServerHandler::run()\n")); - asyncAccept(newSession); + asyncAccept(); } - void asyncAccept(Session& newSession) + void asyncAccept() { - UT_DEBUGMSG(("IOServerHandler::asyncAccept()\n")); - UT_return_if_fail(m_pAcceptor); - m_pAcceptor->async_accept(newSession.getSocket(), + UT_DEBUGMSG(("IOServerHandler::asyncAccept()\n")); + UT_return_if_fail(m_pAcceptor); + session_ptr.reset(new Session(io_service, m_ef)); + m_pAcceptor->async_accept(session_ptr->getSocket(), boost::bind(&IOServerHandler::handleAsyncAccept, - this, asio::placeholders::error, - boost::ref(newSession))); - } - - Session* constructSession(void (*ef)(Session*), TCPAccountHandler& handler) - { - UT_DEBUGMSG(("IOServerHandler::constructSession()\n")); - return new Session(io_service, ef, handler); + this, asio::placeholders::error)); } - /* - Only called fron the abiword main loop - */ - void handleAccept(Session& newSession) - { - UT_DEBUGMSG(("IOServerHandler::handleAccept()\n")); - accept_synchronizer.consume(); - asyncAccept(newSession); - } - - TCPAccountHandler& getAccountHandler() +private: + void _signal() { - return m_handler; + UT_DEBUGMSG(("IOServerHandler::_signal()\n")); + UT_return_if_fail(session_ptr); + session_ptr->asyncReadHeader(); + m_af(this, session_ptr); } -private: - void handleAsyncAccept(const asio::error_code& ec, Session& session) + void handleAsyncAccept(const asio::error_code& ec) { - if (!ec) + UT_DEBUGMSG(("IOServerHandler::handleAsyncAccept()\n")); + if (ec) { - accept_synchronizer.signal(); - session.asyncReadHeader(); + UT_DEBUGMSG(("Error accepting connection: %s\n", ec.message().c_str())); + return; } + accept_synchronizer.signal(); } Synchronizer accept_synchronizer; - asio::io_service io_service; - asio::io_service::work* work; - asio::thread* thread; + asio::io_service& io_service; asio::ip::tcp::acceptor* m_pAcceptor; + boost::shared_ptr session_ptr; - TCPAccountHandler& m_handler; + boost::function)> m_af; + boost::function m_ef; }; #endif /* __IO_SERVER_HANDLER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/Makefile 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/Makefile 2008-07-13 13:05:20.000000000 +0100 @@ -22,9 +22,8 @@ include $(ABI_ROOT)/src/config/abi_defs.mk TARGETS= $(OBJS) -CPPSRCS= TCPAccountHandler.cpp \ - Synchronizer.cpp - +CPPSRCS= TCPAccountHandler.cpp + INCLUDES+= -I$(shell pwd) \ -I$(shell pwd)/../../.. \ -I$(shell pwd)/../../../core/packet \ @@ -32,13 +31,14 @@ -I$(ABI_ROOT)/../libs/boost \ -I$(ABI_ROOT)/../libs/asio/include -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers # compiler (MinGW, MSVC, etc) specific ifeq ($(OS_NAME),MINGW32) + INCLUDES+= -D_WIN32_WINNT=0x0500 else OS_CFLAGS+=-GX endif diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/Session.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/Session.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/Session.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/Session.h 2008-07-13 13:05:20.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2007 by Marc Maurer +/* Copyright (C) 2007,2008 by Marc Maurer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,36 +19,25 @@ #ifndef __SESSION__ #define __SESSION__ +#include +#include #include #include +#include class TCPAccountHandler; class Session : public Synchronizer, public boost::noncopyable { public: - Session(asio::io_service& io_service, void (*ef)(Session*), TCPAccountHandler& handler) - : Synchronizer((void (*)(void*))ef, (void*)this), + Session(asio::io_service& io_service, boost::function ef) + : Synchronizer(boost::bind(&Session::_signal, this)), socket(io_service), queue_protector(), - owner(handler) + m_ef(ef) { } - virtual ~Session() - { - UT_DEBUGMSG(("~Session()\n")); - asio::error_code ecs; - socket.shutdown(asio::ip::tcp::socket::shutdown_both, ecs); - if (ecs) - UT_DEBUGMSG(("Error shutting down socket: %s\n", ecs.message().c_str())); - - asio::error_code ecc; - socket.close(ecc); - if (ecc) - UT_DEBUGMSG(("Error closing socket: %s\n", ecc.message().c_str())); - } - asio::ip::tcp::socket& getSocket() { return socket; @@ -60,7 +49,7 @@ abicollab::scoped_lock lock(queue_protector); incoming.push_back( std::pair(size, data) ); } - signal(); + Synchronizer::signal(); } /* @@ -82,6 +71,7 @@ void asyncReadHeader() { + UT_DEBUGMSG(("Session::asyncReadHeader()\n")); packet_data = 0; // just to be sure we'll never touch a datablock we might have read before asio::async_read(socket, asio::buffer(&packet_size, 4), @@ -117,113 +107,121 @@ { return socket.is_open(); } - - TCPAccountHandler& getAccountHandler() + + void disconnect() { - return owner; + UT_DEBUGMSG(("Session::disconnect()\n")); + if (socket.is_open()) + { + asio::error_code ecs; + socket.shutdown(asio::ip::tcp::socket::shutdown_both, ecs); + if (ecs) + UT_DEBUGMSG(("Error shutting down socket: %s\n", ecs.message().c_str())); + + asio::error_code ecc; + socket.close(ecc); + if (ecc) + UT_DEBUGMSG(("Error closing socket: %s\n", ecc.message().c_str())); + } + UT_DEBUGMSG(("Socket closed, signalling mainloop\n")); + signal(); } private: + void _signal() + { + UT_DEBUGMSG(("Session::_signal()\n")); + m_ef(*this); + } + void asyncReadHeaderHandler(const asio::error_code& error, std::size_t bytes_transferred) { - if (!error) + if (error) { - if (bytes_transferred == 4) - { - UT_DEBUGMSG(("going to read datablock of length: %d\n", packet_size)); - - // now continue reading the packet data - packet_data = reinterpret_cast(malloc(packet_size)); - asio::async_read(socket, - asio::buffer(packet_data, packet_size), - boost::bind(&Session::asyncReadHandler, this, asio::placeholders::error, asio::placeholders::bytes_transferred)); - } - else - close(); // TODO: should not happen, handle this + UT_DEBUGMSG(("asyncReadHeaderHandler error: %s\n", error.message().c_str())); + disconnect(); + return; } - else + + if (bytes_transferred != 4) { - UT_DEBUGMSG(("asyncReadHeaderHandler generic error\n")); - close(); + UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); + disconnect(); // TODO: should not happen, handle this + return; } + + UT_DEBUGMSG(("going to read datablock of length: %d\n", packet_size)); + // now continue reading the packet data + packet_data = reinterpret_cast(malloc(packet_size)); + asio::async_read(socket, + asio::buffer(packet_data, packet_size), + boost::bind(&Session::asyncReadHandler, this, asio::placeholders::error, asio::placeholders::bytes_transferred)); } void asyncReadHandler(const asio::error_code& error, std::size_t bytes_transferred) { - if (!error) + if (error) { - if (bytes_transferred == std::size_t(packet_size)) - { - push(packet_size, packet_data); - // start over for a new packet - asyncReadHeader(); - } - else - { - UT_DEBUGMSG(("asyncReadHandler error: wrong number of byes received: %d, expected: %d\n", bytes_transferred, packet_size)); - close(); - } + UT_DEBUGMSG(("asyncReadHandler generic error\n")); + disconnect(); + return; } - else + + if (bytes_transferred != std::size_t(packet_size)) { - UT_DEBUGMSG(("asyncReadHandler generic error\n")); - close(); + UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); + disconnect(); // TODO: should not happen, handle this + return; } + push(packet_size, packet_data); + // start over for a new packet + asyncReadHeader(); } void asyncWriteHeaderHandler(const asio::error_code& ec) { UT_DEBUGMSG(("Session::asyncWriteHeaderHandler()\n")); - if (!ec) - { - // write the packet body - asio::async_write(socket, - asio::buffer(packet_data_write, packet_size_write), - boost::bind(&Session::asyncWriteHandler, this, asio::placeholders::error)); - } - else + if (ec) { UT_DEBUGMSG(("asyncWriteHeaderHandler generic error\n")); - close(); + disconnect(); + return; } + + // write the packet body + asio::async_write(socket, + asio::buffer(packet_data_write, packet_size_write), + boost::bind(&Session::asyncWriteHandler, this, asio::placeholders::error)); } void asyncWriteHandler(const asio::error_code& ec) { UT_DEBUGMSG(("Session::asyncWriteHandler()\n")); FREEP(packet_data_write); - if (!ec) - { - // TODO: this is a race condition, mutext this - outgoing.pop_front(); - if (outgoing.size() > 0) - { - std::pair p = outgoing.front(); - packet_size_write = p.first; - packet_data_write = p.second; - - UT_DEBUGMSG(("sending datablock of length: %d\n", packet_size_write)); - - asio::async_write(socket, - asio::buffer(&packet_size_write, 4), - boost::bind(&Session::asyncWriteHeaderHandler, this, asio::placeholders::error)); - } - } - else + if (ec) { UT_DEBUGMSG(("asyncWriteHandler generic error\n")); - close(); + disconnect(); + return; } - } - void close() - { - socket.close(); - UT_DEBUGMSG(("socket closed\n")); - signal(); + // TODO: this is a race condition, mutex this + outgoing.pop_front(); + if (outgoing.size() > 0) + { + std::pair p = outgoing.front(); + packet_size_write = p.first; + packet_data_write = p.second; + + UT_DEBUGMSG(("sending datablock of length: %d\n", packet_size_write)); + + asio::async_write(socket, + asio::buffer(&packet_size_write, 4), + boost::bind(&Session::asyncWriteHeaderHandler, this, asio::placeholders::error)); + } } asio::ip::tcp::socket socket; @@ -237,7 +235,7 @@ int packet_size_write; // state needed for async writes char* packet_data_write; // state needed for async writes - TCPAccountHandler& owner; + boost::function m_ef; }; #endif /* __SESSION__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/Synchronizer.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/Synchronizer.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/Synchronizer.cpp 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/Synchronizer.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,326 +0,0 @@ -/* AbiCollab - Code to enable the modification of remote documents. - * Copyright (C) 2007 by Marc Maurer - * Copyright (C) 2007 by Ryan Pavlik - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#include "Synchronizer.h" -// Danger Will Robinson: This file is icky to look at. -// Massive comment blocks used to aid reading in syntax-highlighting editors. - -#include - -#ifndef WIN32 -#include -#endif - -////////////////// -// WINDOWS STATIC MAGIC -////////////////// - -#ifdef WIN32 -#ifndef HWND_MESSAGE -#define HWND_MESSAGE ((HWND)(-3)) -#endif - -static int Synchronizer::sm_iMessageWindows=0; -ATOM sm_iClass = 0; - -static LRESULT CALLBACK Synchronizer::s_wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) // Win32-only -{ - Synchronizer * pThis; - int swlresult; - switch (msg) - { - - case WM_NCCREATE: - pThis = (Synchronizer *)((LPCREATESTRUCT(lParam))->lpCreateParams); - UT_return_val_if_fail(pThis, 0); - pThis->m_hWnd = hWnd; - SetLastError(0); - swlresult=SetWindowLong(hWnd,GWL_USERDATA,long(pThis)); - if (swlresult==0) - { - // we might have an error - int errorcode=GetLastError(); - if (errorcode) - { - UT_DEBUGMSG(("Error in setting the WindowLong GWL_USERDATA: %d\n", errorcode)); - } - - } - return 1; - - case WM_ABI_TCP_BACKEND: - pThis = (Synchronizer *)GetWindowLong(hWnd,GWL_USERDATA); - UT_return_val_if_fail(pThis, 0); - UT_DEBUGMSG(("Received a message in Synchronizer.h message loop! 0x%x\n", msg)); - pThis->fromMainloopCallback(); - return 1; - - default: - UT_DEBUGMSG(("return DefWindowProc for message 0x%x\n", msg)); - // We do not want to handle this message so pass back to Windows - // to handle it in a default way - return DefWindowProc(hWnd, msg, wParam, lParam); - } -} -static void Synchronizer::_registerWndClass() // Win32-only -{ - if (sm_iClass) - { - UT_DEBUGMSG(("Skipping window class registration\n")); - return; - } - - AbiCollabSessionManager * pSessionManager = AbiCollabSessionManager::getManager(); - UT_return_if_fail(pSessionManager); - - HINSTANCE hInstance = pSessionManager->getInstance(); - UT_return_if_fail(hInstance); - - WNDCLASS wc; - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = Synchronizer::s_wndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = NULL; - wc.hCursor = NULL; - wc.hbrBackground = NULL; - wc.lpszMenuName = NULL; - wc.lpszClassName = "AbiTCPSynchronizer"; - - sm_iClass = RegisterClass(&wc); - UT_return_if_fail(sm_iClass); - - sm_iMessageWindows = 0; -} - -static void Synchronizer::_unregisterWndClass() // Win32-only -{ - UT_DEBUGMSG(("Synchronizer::_unregisterWndClass()\n")); - UT_return_if_fail(sm_iClass); - - if (sm_iMessageWindows > 0) - { - UT_DEBUGMSG(("%d message windows still exist, skipping unregistering\n", sm_iMessageWindows)); - return; - } - - AbiCollabSessionManager * pManager = AbiCollabSessionManager::getManager(); - UT_return_if_fail(pManager); - - HINSTANCE hInstance = pManager->getInstance(); - UT_return_if_fail(hInstance); - - UT_DEBUGMSG(("Unregistrating message window class\n")); - UT_return_if_fail(UnregisterClass(sm_iClass, hInstance)); - sm_iClass = NULL; -} - -#endif - -////////////////// -// CONSTRUCTORS -////////////////// - -#ifdef WIN32 -Synchronizer::Synchronizer(void (*f)(void*), void* data) // Win32 Implementation - : f_(f), - data_(data), - m_hWnd(0) -{ - UT_DEBUGMSG(("Synchronizer()\n")); - - AbiCollabSessionManager * pSessionManager= AbiCollabSessionManager::getManager(); - UT_return_if_fail(pSessionManager); - - HINSTANCE hInstance = pSessionManager->getInstance(); - UT_return_if_fail(hInstance); - - _registerWndClass(); - - // HWND_MESSAGE as parent HWND is Win2k/xp/vista only - replaced with 0 - // (also HWND_MESSAGE doesn't compile in MinGW, weird bug. --RP 8 August 2007) - - m_hWnd = CreateWindow("AbiTCPSynchronizer", - "AbiCollab", - 0, - CW_USEDEFAULT, - SW_HIDE, - CW_USEDEFAULT, - CW_USEDEFAULT, - HWND_MESSAGE, - NULL, - hInstance, - (void *) this - ); - - UT_DEBUGMSG(("Created message window: HWND 0x%x\n", m_hWnd)); - switch ((int)m_hWnd) - { - case NULL: - UT_DEBUGMSG(("Win32 error: %d.\n", GetLastError())); - break; - default: - sm_iMessageWindows++; - break; - // ok! - }; -} - -#else - -Synchronizer::Synchronizer(void (*f)(void*), void* data) // Unix Implementation - : f_(f), - data_(data) -{ - UT_DEBUGMSG(("~Synchronizer()\n")); - // on unix, we use the self-pipe trick to signal the glib main loop - fdr = -1; - fdw = -1; - - int pfd[2]; - if (pipe(pfd) == -1) - { - UT_DEBUGMSG(("pipe error!\n")); - // FIXME: throw an exception here, don't just bail out! - exit(EXIT_FAILURE); - } - else - { - fdr = pfd[0]; - fdw = pfd[1]; - - // setup the glib main loop integration - io_channel = g_io_channel_unix_new(fdr); - io_channel_watch_id = g_io_add_watch(io_channel, G_IO_IN, (GIOFunc)s_glib_mainloop_callback, this); - } -} -#endif - -// end constructors -////////////////// - -////////////////// -// DESTRUCTORS -////////////////// - -#ifdef WIN32 -Synchronizer::~Synchronizer() // Win32 Implementation -{ - UT_DEBUGMSG(("~Synchronizer()\n")); - // destroy our window - if (m_hWnd) - { - DestroyWindow(m_hWnd); - m_hWnd = 0; - sm_iMessageWindows--; - } - else - { - UT_DEBUGMSG(("TCP Backend Synchronizer Window already destroyed!\n")); - } - - // Attempt to unregister class - it will check to make sure we're the last one out. - _unregisterWndClass(); -} - -#else - -Synchronizer::~Synchronizer() // Unix Implementation -{ - UT_DEBUGMSG(("~Synchronizer()\n")); - if (fdr != -1) - close(fdr); - if (fdw != -1) - close(fdw); - - g_source_remove(io_channel_watch_id); - //g_io_channel_shutdown(io_channel, TRUE, NULL); - g_io_channel_unref(io_channel); - io_channel_watch_id = 0; -} -#endif -// end destructors -////////////////// - -////////////////// -// SIGNAL -////////////////// -#ifdef WIN32 -void Synchronizer::signal() // Win32 Implementation -{ - UT_DEBUGMSG(("Synchronizer::signal()\n")); - // send a message to the main loop - int result=SendMessage(m_hWnd, WM_ABI_TCP_BACKEND, 0, 0); - UT_DEBUGMSG(("Synchronizer::signal() - SendMessage returned %d\n", result)); -} - -#else - -void Synchronizer::signal() // Unix Implementation -{ - UT_DEBUGMSG(("Synchronizer::signal()\n")); - UT_DEBUGMSG(("Signalling the main loop\n")); - unsigned char signal = 0xff; - if (write(fdw, &signal, 1) != 1) - UT_DEBUGMSG(("Error signaling main loop!\n")); -} -#endif - - - -////////////////// -// CONSUME -////////////////// -void Synchronizer::consume() -{ -#ifdef WIN32 - // void on win32 -#else - // Unix Implementation - char signal = 0; - if (read(fdr, &signal, 1) != 1) - UT_DEBUGMSG(("Error signaling main loop!\n")); -#endif -} - - -////////////////// -// CALLBACK -////////////////// - -void Synchronizer::fromMainloopCallback() // XP -{ - f_(data_); -} - - -////////////////// -// GLOBAL FUNCTIONS -////////////////// - -#ifndef WIN32 -// Unix-only -static gboolean s_glib_mainloop_callback(GIOChannel *channel, GIOCondition condition, Synchronizer* synchronizer) -{ - synchronizer->fromMainloopCallback(); - return TRUE; -} -#endif diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/Synchronizer.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/Synchronizer.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/Synchronizer.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/Synchronizer.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,88 +0,0 @@ -/* AbiCollab - Code to enable the modification of remote documents. - * Copyright (C) 2007 by Marc Maurer - * Copyright (C) 2007 by Ryan Pavlik - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef __SYNCHRONIZER__ -#define __SYNCHRONIZER__ - -#include - -class Synchronizer; - -#ifdef WIN32 -// Windows implementation requirements -#define WM_ABI_TCP_BACKEND WM_USER+15 -#include -#include - -#else - -// Unix implementation requirements -#include -static gboolean s_glib_mainloop_callback(GIOChannel *channel, GIOCondition condition, Synchronizer* synchronizer); -#endif - -class Synchronizer -{ -public: -#ifdef WIN32 - // Windows-only static stuff - static bool sm_bClassRegistered; - static int sm_iMessageWindows; - - static LRESULT CALLBACK s_wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); - static void _registerWndClass(); - static void _unregisterWndClass(); -#endif - - // XP prototypes - Synchronizer(void (*f)(void*), void* data); - virtual ~Synchronizer(); - - void signal(); - void consume(); - - void fromMainloopCallback(); - -private: -////////////////// -// PRIVATE DATA -////////////////// -#ifdef WIN32 - HWND m_hWnd; -#else - int fdr; - int fdw; - GIOChannel* io_channel; - guint io_channel_watch_id; -#endif - -// XP members - void (*f_)(void*); - void* data_; -}; - -////////////////// -// GLOBAL FUNCTIONS + STUFF -////////////////// -#ifndef WIN32 -static gboolean s_glib_mainloop_callback(GIOChannel *channel, GIOCondition condition, Synchronizer* synchronizer); -#endif - -#endif /* __SYNCHRONIZER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPAccountHandler.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPAccountHandler.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPAccountHandler.cpp 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPAccountHandler.cpp 2008-07-13 13:05:20.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2006,2007 by Marc Maurer +/* Copyright (C) 2006-2008 by Marc Maurer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -25,26 +25,13 @@ #include -static void IOAcceptFunc(IOServerHandler* pHandler) -{ - UT_DEBUGMSG(("IOAcceptFunc()\n")); - UT_return_if_fail(pHandler); - pHandler->getAccountHandler().handleAccept(pHandler); -} - -static void IOEventFunc(Session* pSession) -{ - UT_DEBUGMSG(("IOEventFunc()\n")); - UT_return_if_fail(pSession); - pSession->consume(); - pSession->getAccountHandler().handleEvent(*pSession); -} - TCPAccountHandler::TCPAccountHandler() : AccountHandler(), + m_io_service(), + m_work(m_io_service), + m_thread(0), m_bConnected(false), - m_pDelegator(0), - m_pPendingSession(0) + m_pDelegator(0) { } @@ -88,9 +75,10 @@ UT_return_val_if_fail(pManager, CONNECT_INTERNAL_ERROR); UT_return_val_if_fail(!m_pDelegator, CONNECT_INTERNAL_ERROR); - - if (m_bConnected) - return CONNECT_ALREADY_CONNECTED; + UT_return_val_if_fail(!m_bConnected, CONNECT_ALREADY_CONNECTED); + UT_return_val_if_fail(!m_thread, CONNECT_INTERNAL_ERROR); + m_io_service.reset(); + m_thread = new asio::thread(boost::bind(&asio::io_service::run, &m_io_service)); // set up the connection if (getProperty("server") == "") @@ -100,12 +88,12 @@ try { - IOServerHandler* pDelegator = new IOServerHandler(port, IOAcceptFunc, *this); + IOServerHandler* pDelegator = new IOServerHandler(port, + boost::bind(&TCPAccountHandler::_handleAccept, this, _1, _2), + boost::bind(&TCPAccountHandler::handleEvent, this, _1), m_io_service); m_pDelegator = pDelegator; m_bConnected = true; // todo: ask it to the acceptor - - m_pPendingSession = pDelegator->constructSession(IOEventFunc, *this); - pDelegator->run(*m_pPendingSession); + pDelegator->run(); } catch (asio::system_error se) { @@ -123,27 +111,22 @@ else { UT_DEBUGMSG(("Connecting to server %s on port %d...\n", getProperty("server").c_str(), _getPort(getProperties()))); - - // TODO: catch exceptions + boost::shared_ptr session_ptr(new Session(m_io_service, boost::bind(&TCPAccountHandler::handleEvent, this, _1))); + asio::ip::tcp::resolver resolver(m_io_service); + asio::ip::tcp::resolver::query query(getProperty("server"), getProperty("port")); + asio::ip::tcp::resolver::iterator iterator(resolver.resolve(query)); try { - IOClientHandler* pDelegator = new IOClientHandler(getProperty("server"), getProperty("port")); - m_pDelegator = pDelegator; - - Session* pSession = pDelegator->constructSession(IOEventFunc, *this); - if (pSession) - { - pDelegator->connect(*pSession); - m_bConnected = true; // todo: ask it to the socket - - // Add a buddy - UT_UTF8String name = getProperty("server").c_str(); - name += ":"; - name += getProperty("port").c_str(); - TCPBuddy* pBuddy = new TCPBuddy(this, name); - addBuddy(pBuddy); - m_clients.insert(std::pair(pBuddy, pSession)); - } + session_ptr->getSocket().connect(*iterator); + session_ptr->asyncReadHeader(); + m_bConnected = true; // todo: ask it to the socket + // Add a buddy + UT_UTF8String name = getProperty("server").c_str(); + name += ":"; + name += getProperty("port").c_str(); + TCPBuddy* pBuddy = new TCPBuddy(this, name); + addBuddy(pBuddy); + m_clients.insert(std::pair >(pBuddy, session_ptr)); } catch (asio::system_error se) { @@ -151,12 +134,6 @@ _teardownAndDestroyHandler(); return CONNECT_FAILED; } - catch (...) - { - UT_DEBUGMSG(("Caught unhandled client exception!\n")); - _teardownAndDestroyHandler(); - return CONNECT_FAILED; - } } if (!m_bConnected) @@ -195,37 +172,53 @@ void TCPAccountHandler::_teardownAndDestroyHandler() { - UT_return_if_fail(m_pDelegator); - // stop accepting new connections - UT_DEBUGMSG(("Stop accepting connections\n")); - if (m_pPendingSession) - DELETEP(m_pPendingSession); + UT_DEBUGMSG(("Stop accepting connections/packets\n")); + m_io_service.stop(); + if (m_thread) + { + m_thread->join(); + DELETEP(m_thread); + } // ... then tear down all client connections UT_DEBUGMSG(("Tearing down client connections\n")); - for (std::map::iterator it = m_clients.begin(); it != m_clients.end();) - { - std::map::iterator next_it = it; - next_it++; + for (std::map >::iterator it = m_clients.begin(); it != m_clients.end();) + (*it).second->disconnect(); - // const TCPBuddy* pBuddy = (*it).first; - // TODO: signal the buddy leaving && free the buddy - - Session* pSession = (*it).second; - DELETEP(pSession); + // ... then stop the IOServerhandler (if any) + if (m_pDelegator) + { + UT_DEBUGMSG(("Stopping the IOServerhandler\n")); + m_pDelegator->stop(); - m_clients.erase(it); - it = next_it; + // ... and finally kill off the IO handler alltogether + UT_DEBUGMSG(("Deleting the IO handler\n")); + DELETEP(m_pDelegator); } +} - // ... then stop the IO handler - UT_DEBUGMSG(("Stopping the IO handler\n")); - m_pDelegator->stop(); - - // ... and finally kill off the IO handler alltogether - UT_DEBUGMSG(("Deleting the IO handler\n")); - DELETEP(m_pDelegator); +void TCPAccountHandler::_handleMessages(Session& session) +{ + UT_DEBUGMSG(("TCPAccountHandler::_handleMessages()\n")); + + // handle all packets waiting in our queue + int packet_size; + char* packet_data; + while (session.pop(packet_size, &packet_data)) + { + // setup raw packet struct + RawPacket pRp; + pRp.buddy = const_cast(_getBuddy(&session)); + pRp.packet.resize( packet_size ); + memcpy( &pRp.packet[0], packet_data, packet_size ); + + // cleanup packet + FREEP(packet_data); + + // handle! + handleMessage( pRp ); + } } bool TCPAccountHandler::isOnline() @@ -233,29 +226,23 @@ return m_bConnected; // TODO: ask the IO handler } -void TCPAccountHandler::handleAccept(IOServerHandler* pHandler) +void TCPAccountHandler::_handleAccept(IOServerHandler* pHandler, boost::shared_ptr session) { UT_DEBUGMSG(("TCPAccountHandler::handleAccept\n")); - UT_return_if_fail(pHandler); + UT_return_if_fail(session); - if (m_pPendingSession) - { - // store this buddy/session - UT_UTF8String name; - UT_UTF8String_sprintf(name, "%s:%d", - m_pPendingSession->getSocket().remote_endpoint().address().to_string().c_str(), - m_pPendingSession->getSocket().remote_endpoint().port()); - TCPBuddy* pBuddy = new TCPBuddy(this, name); - addBuddy(pBuddy); - m_clients.insert(std::pair(pBuddy, m_pPendingSession)); - } - else - UT_ASSERT_HARMLESS(UT_NOT_REACHED); + // store this buddy/session + UT_UTF8String name; + UT_UTF8String_sprintf(name, "%s:%d", + session->getSocket().remote_endpoint().address().to_string().c_str(), + session->getSocket().remote_endpoint().port()); + TCPBuddy* pBuddy = new TCPBuddy(this, name); + addBuddy(pBuddy); + m_clients.insert(std::pair >(pBuddy, session)); // accept a new buddy/session - m_pPendingSession = pHandler->constructSession(IOEventFunc, *this); - pHandler->handleAccept(*m_pPendingSession); + pHandler->asyncAccept(); } Buddy* TCPAccountHandler::constructBuddy(const PropertyMap& props) @@ -280,77 +267,64 @@ UT_DEBUGMSG(("TCPAccountHandler::forceDisconnectBuddy()\n")); // locate this buddy! - std::map::iterator it=m_clients.find( static_cast(buddy)/*ugly*/ ); - if (it==m_clients.end()) + std::map >::iterator it = m_clients.find( static_cast(buddy)/*ugly*/ ); + if (it == m_clients.end()) { - for (it=m_clients.begin(); it!=m_clients.end(); ++it) - { + for (it = m_clients.begin(); it != m_clients.end(); ++it) if ((*it).first->getName() == buddy->getName()) - { break; - } - } - UT_return_if_fail(it!=m_clients.end()); + UT_return_if_fail(it != m_clients.end()); } // disconnect it - UT_ASSERT(it!=m_clients.end()); - try - { - delete (*it).second; - } - catch (...) - { - UT_DEBUGMSG(("ERROR: exception during delete second\n")); - } - try - { - delete (*it).first; - } - catch (...) - { - UT_DEBUGMSG(("ERROR: exception during delete first\n")); - } - m_clients.erase( it ); + UT_return_if_fail(it != m_clients.end()); + (*it).second->disconnect(); } void TCPAccountHandler::handleEvent(Session& session) { UT_DEBUGMSG(("TCPAccountHandler::handleEvent()\n")); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + + // make sure we have handled _all_ packets in the queue before checking + // the disconnected status + bool disconnected = !session.isConnected(); + _handleMessages(session); - // get an incoming packet, if any - // TODO: we could read all packets here in one go - int packet_size; - char* packet_data; - if (session.pop(packet_size, &packet_data)) + // check the connection status + if (disconnected) { - /* - printf("Got packet:\n"); - for (int i = 0; i < packet_size; i++) + UT_DEBUGMSG(("Socket is not connected anymore!\n")); + // drop all buddies that were on this connection + std::map >::iterator next; + for (std::map >::iterator it = m_clients.begin(); it != m_clients.end(); it = next) { - printf("%02x ", (UT_uint8)packet_data[i] ); - } - printf("\n"); - */ - - // setup raw packet struct - RawPacket pRp; - pRp.buddy = const_cast(_getBuddy(&session)); - pRp.packet.resize( packet_size ); - memcpy( &pRp.packet[0], packet_data, packet_size ); - - // cleanup packet - FREEP(packet_data); + next = it; + next++; - // handle! - handleMessage( pRp ); - } + UT_continue_if_fail((*it).first); + UT_continue_if_fail((*it).second); - // check the connection status - if (!session.isConnected()) - { - UT_DEBUGMSG(("Socket is not connected anymore!!!!!\n")); - // FIXME: handle this (delete the session, and remove it from the client list) + const TCPBuddy* pB = (*it).first; + + if ((*it).second.get() == &session) + { + UT_DEBUGMSG(("Lost connection to %s buddy %s\n", getProperty("server") == "" ? "client" : "server", pB->getName().utf8_str())); + // drop this buddy from all sessions + pManager->removeBuddy(pB, false); + + // erase the buddy <-> session mapping + m_clients.erase(it); + + deleteBuddy(pB->getName()); + } + } + + // if we were connected to a server, then we are basically disconnected now + if (getProperty("server") != "") + disconnect(); } // check other things here if needed... @@ -379,10 +353,10 @@ const TCPBuddy* TCPAccountHandler::_getBuddy(Session* pSession) { - for (std::map::iterator it = m_clients.begin(); it != m_clients.end(); it++) + for (std::map >::iterator it = m_clients.begin(); it != m_clients.end(); it++) { - std::pair pbs = *it; - if (pbs.second == pSession) + std::pair > pbs = *it; + if (pbs.second.get() == pSession) return pbs.first; } UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); @@ -401,9 +375,9 @@ _createPacketStream( data, packet ); // send it to everyone we know! - for (std::map::iterator it = m_clients.begin(); it != m_clients.end(); it++) + for (std::map >::iterator it = m_clients.begin(); it != m_clients.end(); it++) { - std::pair pbs = *it; + std::pair > pbs = *it; if (pbs.second) { pbs.second->asyncWrite(data.size(), data.c_str()); @@ -424,16 +398,16 @@ UT_return_val_if_fail( ourBuddy, false ); // find the session - std::map::iterator pos = m_clients.find( ourBuddy ); + std::map >::iterator pos = m_clients.find( ourBuddy ); if (pos != m_clients.end()) { - Session* pSession = pos->second; - UT_return_val_if_fail(pSession, false); + boost::shared_ptr session_ptr = pos->second; + UT_return_val_if_fail(session_ptr, false); std::string data; _createPacketStream( data, packet ); - pSession->asyncWrite( data.size(), data.c_str() ); + session_ptr->asyncWrite( data.size(), data.c_str() ); return true; } else diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPAccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPAccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPAccountHandler.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPAccountHandler.h 2008-07-13 13:05:20.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2006,2007 by Marc Maurer +/* Copyright (C) 2006-2008 by Marc Maurer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,18 +19,18 @@ #ifndef __TCPACCOUNTHANDLER__ #define __TCPACCOUNTHANDLER__ -#include "IOServerHandler.h" -#include "IOClientHandler.h" - +#include #include +#include "IOServerHandler.h" + class TCPBuddy; #define DEFAULT_TCP_PORT 25509 /* log2(e + pi) * 10^4 */ extern AccountHandlerConstructor TCPAccountHandlerConstructor; -class ABI_EXPORT TCPAccountHandler : public AccountHandler +class TCPAccountHandler : public AccountHandler { public: TCPAccountHandler(); @@ -48,7 +48,6 @@ virtual ConnectResult connect(); virtual bool disconnect(); virtual bool isOnline(); - void handleAccept(IOServerHandler* pHandler); // user management virtual Buddy* constructBuddy(const PropertyMap& props); @@ -61,7 +60,7 @@ virtual bool send(const Packet*, const Buddy& buddy); // event management - void handleEvent(Session& pSession); + void handleEvent(Session& session); protected: @@ -72,13 +71,18 @@ const TCPBuddy* _getBuddy(Session* pSession); private: + void _handleAccept(IOServerHandler* pHandler, boost::shared_ptr session); void _teardownAndDestroyHandler(); + void _handleMessages(Session& session); + + asio::io_service m_io_service; + asio::io_service::work m_work; + asio::thread* m_thread; bool m_bConnected; // TODO: drop this, ask the IO handler - IOHandler* m_pDelegator; + IOServerHandler* m_pDelegator; - Session* m_pPendingSession; // only used when accepting connections - std::map m_clients; // mapping buddies and their accompanying session + std::map > m_clients; // mapping buddies and their accompanying session }; #endif /* __TCPACCOUNTHANDLER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPBuddy.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPBuddy.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPBuddy.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/tcp/xp/TCPBuddy.h 2008-07-13 13:05:20.000000000 +0100 @@ -28,7 +28,7 @@ class DocHandle; -ABI_EXPORT class TCPBuddy : public Buddy + class TCPBuddy : public Buddy { public: TCPBuddy(AccountHandler* handler, const UT_UTF8String& name) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/GNUmakefile.in 2008-04-06 22:37:38.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/GNUmakefile.in 2008-07-13 14:09:58.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/unix/GNUmakefile.in 2008-04-06 22:37:38.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/unix/GNUmakefile.in 2008-07-13 14:09:58.000000000 +0100 @@ -88,6 +88,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/unix/XMPPUnixAccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/unix/XMPPUnixAccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/unix/XMPPUnixAccountHandler.h 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/unix/XMPPUnixAccountHandler.h 2008-07-13 13:05:19.000000000 +0100 @@ -23,7 +23,7 @@ #include "gtk/gtk.h" #include -class ABI_EXPORT XMPPUnixAccountHandler : public XMPPAccountHandler +class XMPPUnixAccountHandler : public XMPPAccountHandler { public: XMPPUnixAccountHandler(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/xp/GNUmakefile.in 2008-04-06 22:37:38.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/xp/GNUmakefile.in 2008-07-13 14:09:58.000000000 +0100 @@ -89,6 +89,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/xp/XMPPAccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/xp/XMPPAccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/xp/XMPPAccountHandler.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/xp/XMPPAccountHandler.h 2008-07-13 13:05:19.000000000 +0100 @@ -43,7 +43,7 @@ extern AccountHandlerConstructor XMPPAccountHandlerConstructor; -class ABI_EXPORT XMPPAccountHandler : public AccountHandler +class XMPPAccountHandler : public AccountHandler { public: XMPPAccountHandler(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/xp/XMPPBuddy.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/xp/XMPPBuddy.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xmpp/xp/XMPPBuddy.h 2008-04-06 22:36:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xmpp/xp/XMPPBuddy.h 2008-07-13 13:05:19.000000000 +0100 @@ -28,7 +28,7 @@ class DocHandle; -ABI_EXPORT class XMPPBuddy : public Buddy + class XMPPBuddy : public Buddy { public: XMPPBuddy(AccountHandler* handler, const UT_UTF8String& name) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/AccountEvent.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/AccountEvent.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/AccountEvent.h 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/AccountEvent.h 2008-07-13 13:05:21.000000000 +0100 @@ -21,55 +21,55 @@ #include "Event.h" -ABI_EXPORT class AccountNewEvent : public Event + class AccountNewEvent : public Event { public: DECLARE_PACKET(AccountNewEvent); }; -ABI_EXPORT class AccountOnlineEvent : public Event + class AccountOnlineEvent : public Event { public: DECLARE_PACKET(AccountOnlineEvent); }; -ABI_EXPORT class AccountOfflineEvent : public Event + class AccountOfflineEvent : public Event { public: DECLARE_PACKET(AccountOfflineEvent); }; -ABI_EXPORT class AccountAddBuddyEvent : public Event + class AccountAddBuddyEvent : public Event { public: DECLARE_PACKET(AccountAddBuddyEvent); }; -ABI_EXPORT class AccountDeleteBuddyEvent : public Event + class AccountDeleteBuddyEvent : public Event { public: DECLARE_PACKET(AccountDeleteBuddyEvent); }; -ABI_EXPORT class AccountBuddyOnlineEvent : public Event + class AccountBuddyOnlineEvent : public Event { public: DECLARE_PACKET(AccountBuddyOnlineEvent); }; -ABI_EXPORT class AccountBuddyOfflineEvent : public Event + class AccountBuddyOfflineEvent : public Event { public: DECLARE_PACKET(AccountBuddyOfflineEvent); }; -ABI_EXPORT class AccountAddBuddyRequestEvent : public Event + class AccountAddBuddyRequestEvent : public Event { public: DECLARE_PACKET(AccountAddBuddyRequestEvent); }; -ABI_EXPORT class AccountBuddyAddDocumentEvent : public Event + class AccountBuddyAddDocumentEvent : public Event { public: DECLARE_PACKET(AccountBuddyAddDocumentEvent); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/AccountHandler.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/AccountHandler.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/AccountHandler.cpp 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/AccountHandler.cpp 2008-07-13 13:05:21.000000000 +0100 @@ -94,6 +94,29 @@ return 0; } +void AccountHandler::deleteBuddy(const UT_UTF8String& name) +{ + for (UT_uint32 i = 0; i < m_vecBuddies.getItemCount(); i++) + { + Buddy* pBuddy = m_vecBuddies.getNthItem(i); + if (pBuddy->getName() == name) + { + m_vecBuddies.deleteNthItem(i); + return; + } + } +} + +void AccountHandler::deleteBuddies() +{ + for (UT_uint32 i = 0; i < m_vecBuddies.getItemCount(); i++) + { + Buddy* pBuddy = m_vecBuddies.getNthItem(i); + DELETEP(pBuddy); + } + m_vecBuddies.clear(); +} + void AccountHandler::forceDisconnectBuddy(Buddy* buddy) { } @@ -119,6 +142,17 @@ send(&event, buddy); } +bool AccountHandler::hasSession(const UT_UTF8String& sSessionId) +{ + for (UT_uint32 i = 0; i < m_vecBuddies.getItemCount(); i++) + { + const Buddy* pBuddy = m_vecBuddies.getNthItem(i); + if (pBuddy->getDocHandle(sSessionId)) + return true; + } + return false; +} + void AccountHandler::signal(const Event& event, const Buddy* pSource) { UT_DEBUGMSG(("AccountHandler::signal()\n")); @@ -148,23 +182,61 @@ } } +// TODO: deprecate this function void AccountHandler::handleMessage(const RawPacket& pRp) { UT_return_if_fail(pRp.buddy); + Packet* pPacket = _createPacket(pRp.packet, pRp.buddy); + UT_return_if_fail(pPacket); + + handleMessage(pPacket, pRp.buddy); +} + +void AccountHandler::handleMessage(Packet* pPacket, Buddy* pBuddy) +{ + UT_return_if_fail(pPacket); + UT_return_if_fail(pBuddy); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + + // + // handle the incoming packet: first check for a protocol error, then ask the + // session manager to handle it, then try to handle it ourselves + // + if (_handleProtocolError(pPacket, pBuddy) || + pManager->processPacket(*this, pPacket, pBuddy)) + { + DELETEP(pPacket); + return; + } + + // it seems we need to handle the packet ourselves + _handlePacket(pPacket, pBuddy); + DELETEP(pPacket); +} + +Packet* AccountHandler::_createPacket(const std::string& packet, Buddy* pBuddy) +{ + UT_return_val_if_fail(pBuddy, NULL); + // create archive - IStrArchive isa( pRp.packet ); + IStrArchive isa( packet ); // serialize version int version; isa << COMPACT_INT(version); - if (version!=ABICOLLAB_PROTOCOL_VERSION) { - if (version>0) { + if (version != ABICOLLAB_PROTOCOL_VERSION) + { + if (version > 0) + { UT_DEBUGMSG(("Discarding packet, wrong version %d (expected %d)\n", version, ABICOLLAB_PROTOCOL_VERSION)); - _sendProtocolError( *pRp.buddy, PE_Invalid_Version ); - return; + _sendProtocolError(*pBuddy, PE_Invalid_Version); + return NULL; } - else { + else + { UT_DEBUGMSG(("Got error packet (hopefully), revision=%d\n", version)); // if it's a version 0 message, handle normally, picked up in _handlePacket } @@ -174,24 +246,19 @@ UT_uint8 classId; isa << classId; Packet* newPacket = Packet::createPacket( (PClassType)classId ); - if (!newPacket) { + if (!newPacket) + { UT_DEBUGMSG(("Discarding packet, got unknown class %d\n", classId)); - return; + return NULL; } // debug - UT_DEBUGMSG(("PACKET RECEIVED: [%s] %u bytes in serialized string\n", Packet::getPacketClassname( (PClassType)classId ), isa.Size())); + UT_DEBUGMSG(("PACKET DESERIALIZED: [%s] %u bytes in serialized string\n", Packet::getPacketClassname( (PClassType)classId ), isa.Size())); // serialize packet isa << *newPacket; - - // handle packet: - // NOTE: uwog didn't want a "packet->execute" like construction, - // so we're checking the packet type here - _handlePacket( newPacket, pRp.buddy ); - - // cleanup - DELETEP(newPacket); + + return newPacket; } void AccountHandler::_createPacketStream( std::string& sString, const Packet* pPacket ) @@ -218,7 +285,26 @@ UT_DEBUGMSG(("PACKET SENT: [%s] %u bytes in serialized string\n", Packet::getPacketClassname( (PClassType)classId ), osa.Size())); } -void AccountHandler::_handlePacket( Packet* packet, Buddy* buddy ) +bool AccountHandler::_handleProtocolError(Packet* packet, Buddy* buddy) +{ + // packet and buddy must always be set + UT_return_val_if_fail(packet, false); + UT_return_val_if_fail(buddy, false); + + // error report? + if (packet->getClassType() != PCT_ProtocolErrorPacket) + return false; + + // we have an error! + ProtocolErrorPacket* pee = static_cast( packet ); + // report the error + _reportProtocolError( pee->getRemoteVersion(), pee->getErrorEnum(), *buddy ); + // and remove buddy + forceDisconnectBuddy( buddy ); + return true; +} + +void AccountHandler::_handlePacket( Packet* packet, Buddy* buddy, bool autoAddBuddyOnJoin ) { // packet and buddy must always be set UT_return_if_fail(packet); @@ -228,58 +314,46 @@ AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); UT_return_if_fail(pManager); - // error report? - if (packet->getClassType()==PCT_ProtocolErrorPacket) - { - ProtocolErrorPacket* pee = static_cast( packet ); + // manager didn't handle it, see what we can do + switch (packet->getClassType()) + { + case PCT_JoinSessionRequestEvent: + { + JoinSessionRequestEvent* jse = static_cast( packet ); + + // lookup session + AbiCollab* pSession = pManager->getSessionFromSessionId( jse->getSessionId() ); + UT_return_if_fail(pSession); - // report error - _reportProtocolError( pee->getRemoteVersion(), pee->getErrorEnum(), *buddy ); + // lookup exporter + ABI_Collab_Export* pExport = pSession->getExport(); + UT_return_if_fail(pExport); + + // lookup adjusts + const UT_GenericVector* pExpAdjusts = pExport->getAdjusts(); + UT_return_if_fail(pExpAdjusts); - // and remove buddy - forceDisconnectBuddy( buddy ); - } - // see if manager can handle this - else if (!pManager->processPacket( *this, packet, buddy->getName() )) - { - // manager didn't handle it, see what we can do - switch (packet->getClassType()) - { - case PCT_JoinSessionRequestEvent: + // TODO: ask the user to authorize this request + bool bAuthorized = true; + if (bAuthorized) { - JoinSessionRequestEvent* jse = static_cast( packet ); + PD_Document* pDoc = pSession->getDocument(); - // lookup session - AbiCollab* pSession = pManager->getSessionFromSessionId( jse->getSessionId() ); - UT_return_if_fail(pSession); - - // lookup exporter - ABI_Collab_Export* pExport = pSession->getExport(); - UT_return_if_fail(pExport); - - // lookup adjusts - const UT_GenericVector* pExpAdjusts = pExport->getAdjusts(); - UT_return_if_fail(pExpAdjusts); - - // TODO: ask the user to authorize this request - bool bAuthorized = true; - if (bAuthorized) + // serialize entire document into string + JoinSessionRequestResponseEvent jsre( jse->getSessionId() ); + if (AbiCollabSessionManager::serializeDocument(pDoc, jsre.m_sZABW, false /* no base64 */) == UT_OK) { - PD_Document* pDoc = pSession->getDocument(); + // set more document properties + jsre.m_iRev = pDoc->getCRNumber(); + jsre.m_sDocumentId = pDoc->getDocUUIDString(); + if (pDoc->getFilename()) + jsre.m_sDocumentName = UT_go_basename_from_uri(pDoc->getFilename()); - // serialize entire document into string - JoinSessionRequestResponseEvent jsre( jse->getSessionId() ); - if (AbiCollabSessionManager::serializeDocument(pDoc, jsre.m_sZABW, false /* no base64 */) == UT_OK) + // send to buddy! + send( &jsre, *buddy ); + + if (autoAddBuddyOnJoin) { - // set more document properties - jsre.m_iRev = pDoc->getCRNumber(); - jsre.m_sDocumentId = pDoc->getDocUUIDString(); - if (pDoc->getFilename()) - jsre.m_sDocumentName = UT_go_basename_from_uri(pDoc->getFilename()); - - // send to buddy! - send( &jsre, *buddy ); - // check if we already know this buddy Buddy* existing = getBuddy(buddy->getName()); if (!existing) @@ -288,84 +362,92 @@ buddy->setVolatile(true); addBuddy(buddy); } - - // add this buddy to the collaboration session - pSession->addCollaborator(buddy); } + + // add this buddy to the collaboration session + pSession->addCollaborator(buddy); } - break; } - - case PCT_JoinSessionRequestResponseEvent: + break; + } + + case PCT_JoinSessionRequestResponseEvent: + { + JoinSessionRequestResponseEvent* jsre = static_cast( packet ); + PD_Document* pDoc = 0; + if (AbiCollabSessionManager::deserializeDocument(&pDoc, jsre->m_sZABW, false) == UT_OK) { - JoinSessionRequestResponseEvent* jsre = static_cast( packet ); - PD_Document* pDoc = 0; - if (AbiCollabSessionManager::deserializeDocument(&pDoc, jsre->m_sZABW, false) == UT_OK) + if (pDoc) { - if (pDoc) + // NOTE: we could adopt the same document name here, but i'd + // rather not at the moment - MARCM + pDoc->forceDirty(); + if (jsre->m_sDocumentName.size() > 0) { - // NOTE: we could adopt the same document name here, but i'd - // rather not at the moment - MARCM - pDoc->forceDirty(); - pManager->joinSession( jsre->getSessionId(), pDoc, jsre->m_sDocumentId, jsre->m_iRev, buddy ); + gchar* fname = g_strdup(jsre->m_sDocumentName.utf8_str()); + pDoc->setFilename(fname); } - else - UT_DEBUGMSG(("XMPPAccountHandler::_handleJoinSessionResponse() - deserializing document failed!\n")); + pManager->joinSession( jsre->getSessionId(), pDoc, jsre->m_sDocumentId, jsre->m_iRev, buddy, NULL ); } - break; + else + UT_DEBUGMSG(("AccountHandler::_handlePacket() - deserializing document failed!\n")); } - - case PCT_GetSessionsEvent: + break; + } + + case PCT_GetSessionsEvent: + { + GetSessionsResponseEvent gsre; + const UT_GenericVector sessions = pManager->getSessions(); + for (UT_uint32 i = 0; i < sessions.getItemCount(); i++) { - GetSessionsResponseEvent gsre; - const UT_GenericVector sessions = pManager->getSessions(); - for (UT_uint32 i = 0; i < sessions.getItemCount(); i++) + AbiCollab* pSession = sessions.getNthItem(i); + if (pSession && pSession->isLocallyControlled()) { - AbiCollab* pSession = sessions.getNthItem(i); - if (pSession && pSession->isLocallyControlled()) + const PD_Document * pDoc = pSession->getDocument(); + if (pDoc) { - const PD_Document * pDoc = pSession->getDocument(); - if (pDoc) - { - // determine name - UT_UTF8String documentBaseName; - if (pDoc->getFilename()) - documentBaseName = UT_go_basename_from_uri(pDoc->getFilename()); - // set session info - gsre.m_Sessions[ pSession->getSessionId() ] = documentBaseName; - } - else - UT_ASSERT(UT_SHOULD_NOT_HAPPEN); + // determine name + UT_UTF8String documentBaseName; + if (pDoc->getFilename()) + documentBaseName = UT_go_basename_from_uri(pDoc->getFilename()); + // set session info + gsre.m_Sessions[ pSession->getSessionId() ] = documentBaseName; } + else + UT_ASSERT(UT_SHOULD_NOT_HAPPEN); } - send(&gsre, *buddy); - break; - } - - case PCT_GetSessionsResponseEvent: - { - GetSessionsResponseEvent* gsre = static_cast( packet ); - UT_GenericVector vDocHandles; - for (std::map::iterator it=gsre->m_Sessions.begin(); it!=gsre->m_Sessions.end(); ++it) { - DocHandle* pDocHandle = new DocHandle((*it).first, (*it).second); - vDocHandles.addItem(pDocHandle); - } - pManager->setDocumentHandles( *buddy, vDocHandles ); - break; } - - default: - { - break; + send(&gsre, *buddy); + break; + } + + case PCT_GetSessionsResponseEvent: + { + GetSessionsResponseEvent* gsre = static_cast( packet ); + UT_GenericVector vDocHandles; + for (std::map::iterator it=gsre->m_Sessions.begin(); it!=gsre->m_Sessions.end(); ++it) { + DocHandle* pDocHandle = new DocHandle((*it).first, (*it).second); + vDocHandles.addItem(pDocHandle); } + pManager->setDocumentHandles( *buddy, vDocHandles ); + break; + } + + default: + { + UT_DEBUGMSG(("Unhandled packet class: 0x%x\n", packet->getClassType())); + UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); + break; } } } #ifdef WIN32 +// return true if we process the command, false otherwise BOOL AccountHandler::_onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { - return 1; // not handled by default + return false; } #endif diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/AccountHandler.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/AccountHandler.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/AccountHandler.h 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/AccountHandler.h 2008-07-13 13:05:21.000000000 +0100 @@ -54,7 +54,7 @@ typedef map PropertyMap; -ABI_EXPORT class ProtocolErrorPacket : public Packet + class ProtocolErrorPacket : public Packet { public: ProtocolErrorPacket(); @@ -72,7 +72,7 @@ UT_sint32 m_remoteVersion; }; -ABI_EXPORT class AccountHandler : public EventListener + class AccountHandler : public EventListener { public: AccountHandler() {} @@ -84,7 +84,7 @@ virtual UT_UTF8String getStorageType() = 0; void addProperty(const string& key, const string& value) - { m_properties.insert(PropertyMap::value_type(key, value)); } + { m_properties[key] = value; } const string getProperty(const string& key); PropertyMap& getProperties() { return m_properties; } @@ -115,8 +115,9 @@ void addBuddy(Buddy* buddy); const UT_GenericVector& getBuddies() const { return m_vecBuddies; } - Buddy* getBuddy(const UT_UTF8String& name); + void deleteBuddy(const UT_UTF8String& name); + void deleteBuddies(); virtual Buddy* constructBuddy(const PropertyMap& vProps) = 0; virtual bool allowsManualBuddies() = 0; virtual void forceDisconnectBuddy(Buddy* buddy); @@ -128,40 +129,41 @@ { m_bCanOffer = bCanOffer; } // session management - void getSessionsAsync(); - void getSessionsAsync(const Buddy& buddy); - void joinSessionAsync(const Buddy& buddy, DocHandle& docHandle); + virtual void getSessionsAsync(); + virtual void getSessionsAsync(const Buddy& buddy); + virtual void joinSessionAsync(const Buddy& buddy, DocHandle& docHandle); + virtual bool hasSession(const UT_UTF8String& sSessionId); // generic session management packet implementation virtual void handleMessage(const RawPacket& pRp); + virtual void handleMessage(Packet* pPacket, Buddy* pBuddy); // signal management virtual void signal(const Event& event, const Buddy* pSource); + // protocol error management + static void enableProtocolErrorReports(bool enable); // NOTE: enabled by default! + enum + { + PE_Invalid_Version = 1, // only possible error atm ^_^ + }; + protected: + Packet* _createPacket(const std::string& packet, Buddy* pBuddy); + void _createPacketStream(std::string& sString, const Packet* pPacket); // creates binary string! + void _sendProtocolError(const Buddy& buddy, UT_sint32 errorEnum); + virtual bool _handleProtocolError(Packet* packet, Buddy* buddy); + virtual void _handlePacket(Packet* packet, Buddy* buddy, bool autoAddBuddyOnJoin = false); // bad bad, protected variables are bad PropertyMap m_properties; - void _createPacketStream( std::string& sString, const Packet* pPacket ); // creates binary string! - private: + static void _reportProtocolError(UT_sint32 remoteVersion, UT_sint32 errorEnum, const Buddy& buddy); + static bool showProtocolErrorReports; + bool m_bCanOffer; UT_GenericVector m_vecBuddies; - - void _handlePacket( Packet* packet, Buddy* buddy ); - - -public: - static void enableProtocolErrorReports( bool enable ); // NOTE: enabled by default! - enum { - PE_Invalid_Version = 1, // only possible error atm ^_^ - }; -protected: - void _sendProtocolError( const Buddy& buddy, UT_sint32 errorEnum ); -private: - static void _reportProtocolError( UT_sint32 remoteVersion, UT_sint32 errorEnum, const Buddy& buddy ); - static bool showProtocolErrorReports; }; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/BackendPackets.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/BackendPackets.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/BackendPackets.cpp 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/BackendPackets.cpp 2008-07-13 13:05:21.000000000 +0100 @@ -19,6 +19,26 @@ * 02111-1307, USA. */ +#include +#include + +#include +#include +#include + +#include "ut_vector.h" +#include "pd_Document.h" +#include "px_ChangeRecord.h" +#include "px_CR_SpanChange.h" +#include "px_CR_FmtMarkChange.h" +#include "px_CR_SpanChange.h" +#include "px_CR_FmtMark.h" +#include "px_CR_Span.h" +#include "px_CR_Glob.h" +#include "px_CR_StruxChange.h" +#include "px_CR_ObjectChange.h" +#include "px_CR_Strux.h" +#include "px_CR_Object.h" #include "DocHandle.h" #include #include "Event.h" diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Buddy.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Buddy.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Buddy.h 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Buddy.h 2008-07-13 13:05:21.000000000 +0100 @@ -30,7 +30,7 @@ using std::vector; -ABI_EXPORT class Buddy + class Buddy { public: Buddy(AccountHandler* handler, const UT_UTF8String& name) @@ -66,11 +66,11 @@ void addDocHandle(DocHandle* pDocHandle); const vector& getDocHandles() const { return m_docHandles; } - DocHandle* getDocHandle(const UT_UTF8String& sSessionId) + DocHandle* getDocHandle(const UT_UTF8String& sSessionId) const { - for (std::vector::iterator it = m_docHandles.begin(); it != m_docHandles.end(); it++) + for (std::vector::const_iterator cit = m_docHandles.begin(); cit != m_docHandles.end(); cit++) { - DocHandle* pHandle = *it; + DocHandle* pHandle = *cit; if (pHandle->getSessionId() == sSessionId) return pHandle; } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/DocHandle.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/DocHandle.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/DocHandle.h 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/DocHandle.h 2008-07-13 13:05:21.000000000 +0100 @@ -22,7 +22,7 @@ #include "ut_string_class.h" class AbiCollab; -ABI_EXPORT class DocHandle + class DocHandle { public: DocHandle(const UT_UTF8String& sSessionId, const UT_UTF8String& name) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Event.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Event.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Event.h 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Event.h 2008-07-13 13:05:21.000000000 +0100 @@ -21,7 +21,7 @@ #include -ABI_EXPORT class Event : public EventPacket + class Event : public EventPacket { public: DECLARE_ABSTRACT_PACKET(Event); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/EventListener.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/EventListener.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/EventListener.h 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/EventListener.h 2008-07-13 13:05:21.000000000 +0100 @@ -22,7 +22,7 @@ class Event; class Buddy; -ABI_EXPORT class EventListener + class EventListener { public: virtual ~EventListener() diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/GNUmakefile.am /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/GNUmakefile.am --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/GNUmakefile.am 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/GNUmakefile.am 2008-07-13 13:05:21.000000000 +0100 @@ -28,6 +28,10 @@ lock.h \ SessionEvent.cpp \ SessionEvent.h \ + Synchronizer.cpp \ + Synchronizer.h \ + SynchronizedQueue.h \ + tls_tunnel.h \ BackendPackets.cpp libAbiCollabBackends_la_LIBADD = @ABI_LIBS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/GNUmakefile.in 2008-04-06 22:37:38.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/GNUmakefile.in 2008-07-13 14:09:59.000000000 +0100 @@ -56,7 +56,7 @@ libAbiCollabBackends_la_DEPENDENCIES = $(am__append_1) $(am__append_2) \ $(am__append_3) $(am__append_4) $(am__append_5) am_libAbiCollabBackends_la_OBJECTS = AccountEvent.lo AccountHandler.lo \ - Buddy.lo SessionEvent.lo BackendPackets.lo + Buddy.lo SessionEvent.lo Synchronizer.lo BackendPackets.lo libAbiCollabBackends_la_OBJECTS = \ $(am_libAbiCollabBackends_la_OBJECTS) libAbiCollabBackends_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ @@ -347,6 +349,10 @@ lock.h \ SessionEvent.cpp \ SessionEvent.h \ + Synchronizer.cpp \ + Synchronizer.h \ + SynchronizedQueue.h \ + tls_tunnel.h \ BackendPackets.cpp libAbiCollabBackends_la_LIBADD = @ABI_LIBS@ $(am__append_1) \ @@ -409,6 +415,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BackendPackets.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Buddy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SessionEvent.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Synchronizer.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/lock.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/lock.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/lock.h 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/lock.h 2008-07-13 13:05:21.000000000 +0100 @@ -16,6 +16,9 @@ * 02111-1307, USA. */ +#ifndef __ABICOLLAB_LOCK__ +#define __ABICOLLAB_LOCK__ + #ifndef WIN32 #include #endif @@ -92,3 +95,4 @@ } +#endif /* __ABICOLLAB_LOCK__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Makefile 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Makefile 2008-07-13 13:05:21.000000000 +0100 @@ -24,6 +24,7 @@ TARGETS= $(OBJS) CPPSRCS= AccountHandler.cpp \ AccountEvent.cpp \ + Synchronizer.cpp \ SessionEvent.cpp \ BackendPackets.cpp \ Buddy.cpp @@ -34,7 +35,7 @@ -I$(shell pwd)/../../core/session \ -I$(ABI_ROOT)/../libs/boost -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/SessionEvent.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/SessionEvent.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/SessionEvent.h 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/SessionEvent.h 2008-07-13 13:05:21.000000000 +0100 @@ -24,26 +24,26 @@ #include #include -ABI_EXPORT class StartSessionEvent : public Event + class StartSessionEvent : public Event { public: DECLARE_PACKET(StartSessionEvent); }; -ABI_EXPORT class GetSessionsEvent : public Event + class GetSessionsEvent : public Event { public: DECLARE_PACKET(GetSessionsEvent); }; -ABI_EXPORT class GetSessionsResponseEvent : public Event + class GetSessionsResponseEvent : public Event { public: DECLARE_PACKET(GetSessionsResponseEvent); std::map m_Sessions; // contains session/name pairs }; -ABI_EXPORT class JoinSessionEvent : public Event + class JoinSessionEvent : public Event { public: DECLARE_PACKET(JoinSessionEvent); @@ -56,14 +56,14 @@ virtual std::string toStr() const; - const UT_UTF8String& getSessionId() + const UT_UTF8String& getSessionId() const { return m_sSessionId; } private: UT_UTF8String m_sSessionId; }; -ABI_EXPORT class JoinSessionRequestEvent : public JoinSessionEvent { + class JoinSessionRequestEvent : public JoinSessionEvent { public: DECLARE_PACKET(JoinSessionRequestEvent); JoinSessionRequestEvent() {} @@ -71,7 +71,7 @@ : JoinSessionEvent(sessionId) {} }; -ABI_EXPORT class JoinSessionRequestResponseEvent : public Event + class JoinSessionRequestResponseEvent : public Event { public: DECLARE_PACKET(JoinSessionRequestResponseEvent); @@ -85,7 +85,7 @@ UT_ASSERT(m_sSessionId != ""); } - const UT_UTF8String& getSessionId() + const UT_UTF8String& getSessionId() const { return m_sSessionId; } virtual std::string toStr() const; @@ -99,7 +99,7 @@ UT_UTF8String m_sSessionId; }; -ABI_EXPORT class DisjoinSessionEvent : public Event + class DisjoinSessionEvent : public Event { public: DECLARE_PACKET(DisjoinSessionEvent); @@ -112,14 +112,14 @@ virtual std::string toStr() const; - const UT_UTF8String& getSessionId() + const UT_UTF8String& getSessionId() const { return m_sSessionId; } private: UT_UTF8String m_sSessionId; }; -ABI_EXPORT class CloseSessionEvent : public Event + class CloseSessionEvent : public Event { public: DECLARE_PACKET(CloseSessionEvent); @@ -132,7 +132,7 @@ virtual std::string toStr() const; - const UT_UTF8String& getSessionId() + const UT_UTF8String& getSessionId() const { return m_sSessionId; } private: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/SynchronizedQueue.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/SynchronizedQueue.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/SynchronizedQueue.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/SynchronizedQueue.h 2008-07-13 13:05:21.000000000 +0100 @@ -0,0 +1,74 @@ +/* Copyright (C) 2008 by Marc Maurer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __SYNCHRONIZED_QUEUE__ +#define __SYNCHRONIZED_QUEUE__ + +#include +#include +#include +#include +#include + +class EmptyQueueException {}; + +template +class SynchronizedQueue : public Synchronizer, public boost::noncopyable +{ +public: + SynchronizedQueue(boost::function sig) + : Synchronizer(boost::bind(&SynchronizedQueue::_signal, this)), + m_mutex(), + m_queue(), + m_sig(sig) + {} + + void push(T t) + { + abicollab::scoped_lock lock(m_mutex); + m_queue.push_back( t ); + Synchronizer::signal(); + } + + T pop() + { + if (m_queue.size() == 0) + throw EmptyQueueException(); + abicollab::scoped_lock lock(m_mutex); + T t = m_queue.front(); + m_queue.pop_front(); + return t; + } + + bool peek() + { + return m_queue.size() > 0; + } + +private: + void _signal() + { + m_sig(*this); + } + + abicollab::mutex m_mutex; + std::deque< T > m_queue; + boost::function m_sig; +}; + +#endif /* __SYNCHRONIZED_QUEUE__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Synchronizer.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Synchronizer.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Synchronizer.cpp 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Synchronizer.cpp 2008-07-13 13:05:21.000000000 +0100 @@ -0,0 +1,304 @@ +/* AbiCollab - Code to enable the modification of remote documents. + * Copyright (C) 2007,2008 by Marc Maurer + * Copyright (C) 2007 by Ryan Pavlik + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include "Synchronizer.h" +// Danger Will Robinson: This file is icky to look at. +// Massive comment blocks used to aid reading in syntax-highlighting editors. + +#include + +#ifndef WIN32 +static gboolean s_glib_mainloop_callback(GIOChannel *channel, GIOCondition condition, Synchronizer* synchronizer) +{ + synchronizer->callMainloop(); + return TRUE; +} +#endif + +////////////////// +// WINDOWS STATIC MAGIC +////////////////// + +#ifdef WIN32 +#ifndef HWND_MESSAGE +#define HWND_MESSAGE ((HWND)(-3)) +#endif + +#define SYNC_CLASSNAME "AbiCollabSynchronizer" + +int Synchronizer::sm_iMessageWindows = 0; +ATOM sm_iClass = 0; + +LRESULT CALLBACK Synchronizer::s_wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) // Win32-only +{ + Synchronizer * pThis; + int swlresult; + switch (msg) + { + + case WM_NCCREATE: + pThis = (Synchronizer *)((LPCREATESTRUCT(lParam))->lpCreateParams); + UT_return_val_if_fail(pThis, 0); + pThis->m_hWnd = hWnd; + SetLastError(0); + swlresult=SetWindowLong(hWnd,GWL_USERDATA,long(pThis)); + if (swlresult==0) + { + // we might have an error + int errorcode=GetLastError(); + if (errorcode) + { + UT_DEBUGMSG(("Error in setting the WindowLong GWL_USERDATA: %d\n", errorcode)); + } + + } + return 1; + + case WM_ABI_SYNCHRONIZER: + UT_DEBUGMSG(("Received a message in Synchronizer message loop! 0x%x\n", msg)); + pThis = (Synchronizer *)GetWindowLong(hWnd,GWL_USERDATA); + UT_return_val_if_fail(pThis, 0); + pThis->callMainloop(); + return 1; + + default: + UT_DEBUGMSG(("return DefWindowProc for message 0x%x\n", msg)); + // We do not want to handle this message so pass back to Windows + // to handle it in a default way + return 0; + } +} + +void Synchronizer::_registerWndClass() // Win32-only +{ + if (sm_iClass) + { + UT_DEBUGMSG(("Skipping window class registration\n")); + return; + } + + AbiCollabSessionManager * pSessionManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pSessionManager); + + HINSTANCE hInstance = pSessionManager->getInstance(); + UT_return_if_fail(hInstance); + + WNDCLASS wc; + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = Synchronizer::s_wndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = NULL; + wc.hCursor = NULL; + wc.hbrBackground = NULL; + wc.lpszMenuName = NULL; + wc.lpszClassName = SYNC_CLASSNAME; + + sm_iClass = RegisterClass(&wc); + UT_return_if_fail(sm_iClass); + + sm_iMessageWindows = 0; +} + +void Synchronizer::_unregisterWndClass() // Win32-only +{ + UT_DEBUGMSG(("Synchronizer::_unregisterWndClass()\n")); + UT_return_if_fail(sm_iClass); + + if (sm_iMessageWindows > 0) + { + UT_DEBUGMSG(("%d message windows still exist, skipping unregistering\n", sm_iMessageWindows)); + return; + } + + AbiCollabSessionManager * pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + + HINSTANCE hInstance = pManager->getInstance(); + UT_return_if_fail(hInstance); + + UT_DEBUGMSG(("Unregistrating message window class\n")); + UT_return_if_fail(UnregisterClass(SYNC_CLASSNAME, hInstance)); + sm_iClass = 0; +} + +#endif + +////////////////// +// CONSTRUCTORS +////////////////// + +#ifdef WIN32 +Synchronizer::Synchronizer(boost::function signalhandler) // Win32 Implementation + : m_signalhandler(signalhandler), + m_hWnd(0) +{ + UT_DEBUGMSG(("Synchronizer()\n")); + AbiCollabSessionManager * pSessionManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pSessionManager); + + HINSTANCE hInstance = pSessionManager->getInstance(); + UT_return_if_fail(hInstance); + + _registerWndClass(); + + // HWND_MESSAGE as parent HWND is Win2k/xp/vista only - replaced with 0 + // (also HWND_MESSAGE doesn't compile in MinGW, weird bug. --RP 8 August 2007) + + m_hWnd = CreateWindow(SYNC_CLASSNAME, + "AbiCollab", + 0, + CW_USEDEFAULT, + SW_HIDE, + CW_USEDEFAULT, + CW_USEDEFAULT, + HWND_MESSAGE, + NULL, + hInstance, + (void *) this + ); + UT_DEBUGMSG(("Created message window: HWND 0x%x\n", m_hWnd)); + switch ((int)m_hWnd) + { + case NULL: + UT_DEBUGMSG(("Win32 error: %d.\n", GetLastError())); + break; + default: + sm_iMessageWindows++; + break; + // ok! + }; +} + +#else + +Synchronizer::Synchronizer(boost::function signalhandler) // Unix Implementation + : m_signalhandler(signalhandler) +{ + UT_DEBUGMSG(("Synchronizer()\n")); + // on unix, we use the self-pipe trick to signal the glib main loop + fdr = -1; + fdw = -1; + + int pfd[2]; + if (pipe(pfd) == -1) + { + UT_DEBUGMSG(("pipe error!\n")); + // FIXME: throw an exception here, don't just bail out! + exit(EXIT_FAILURE); + } + else + { + fdr = pfd[0]; + fdw = pfd[1]; + + // setup the glib main loop integration + io_channel = g_io_channel_unix_new(fdr); + io_channel_watch_id = g_io_add_watch(io_channel, G_IO_IN, (GIOFunc)s_glib_mainloop_callback, this); + } +} +#endif + +// end constructors +////////////////// + +////////////////// +// DESTRUCTORS +////////////////// + +#ifdef WIN32 +Synchronizer::~Synchronizer() // Win32 Implementation +{ + UT_DEBUGMSG(("~Synchronizer()\n")); + // destroy our window + if (m_hWnd) + { + DestroyWindow(m_hWnd); + m_hWnd = 0; + sm_iMessageWindows--; + } + else + { + UT_DEBUGMSG(("AbiCollab Synchronizer Window already destroyed!\n")); + } + + // Attempt to unregister class - it will check to make sure we're the last one out. + _unregisterWndClass(); +} + +#else + +Synchronizer::~Synchronizer() // Unix Implementation +{ + UT_DEBUGMSG(("~Synchronizer()\n")); + if (fdr != -1) + close(fdr); + if (fdw != -1) + close(fdw); + + g_source_remove(io_channel_watch_id); + //g_io_channel_shutdown(io_channel, TRUE, NULL); + g_io_channel_unref(io_channel); + io_channel_watch_id = 0; +} +#endif +// end destructors +////////////////// + +////////////////// +// SIGNAL +////////////////// +#ifdef WIN32 +void Synchronizer::signal() // Win32 Implementation +{ + UT_DEBUGMSG(("Synchronizer::signal()\n")); + // send a message to the main loop + int result = PostMessage(m_hWnd, WM_ABI_SYNCHRONIZER, 0, 0); + UT_ASSERT(result != 0); +} + +#else + +void Synchronizer::signal() // Unix Implementation +{ + UT_DEBUGMSG(("Signalling the main loop\n")); + unsigned char signal = 0xff; + if (write(fdw, &signal, 1) != 1) + UT_DEBUGMSG(("Error signaling main loop!\n")); +} +#endif + + + +////////////////// +// CONSUME +////////////////// +void Synchronizer::_consume() +{ +#ifdef WIN32 + // void on win32 +#else + // Unix Implementation + char signal = 0; + if (read(fdr, &signal, 1) != 1) + UT_DEBUGMSG(("Error signaling main loop!\n")); +#endif +} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Synchronizer.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Synchronizer.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/Synchronizer.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/Synchronizer.h 2008-07-13 13:05:21.000000000 +0100 @@ -0,0 +1,84 @@ +/* AbiCollab - Code to enable the modification of remote documents. + * Copyright (C) 2007-2008 by Marc Maurer + * Copyright (C) 2007 by Ryan Pavlik + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __SYNCHRONIZER__ +#define __SYNCHRONIZER__ + +#include +#include + +class Synchronizer; + +#ifdef WIN32 +// Windows implementation requirements +#define WM_ABI_SYNCHRONIZER WM_USER+15 +#include +#include +#else +// Unix implementation requirements +#include +#include +#endif + +class Synchronizer +{ +public: +#ifdef WIN32 + // Windows-only static stuff + static bool sm_bClassRegistered; + static int sm_iMessageWindows; + + static LRESULT CALLBACK s_wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + static void _registerWndClass(); + static void _unregisterWndClass(); +#endif + + // XP prototypes + Synchronizer(boost::function signalhandler); + virtual ~Synchronizer(); + + void signal(); + + void callMainloop() + { + _consume(); + m_signalhandler(); + } + +private: + void _consume(); + +////////////////// +// PRIVATE DATA +////////////////// +// XP members + boost::function m_signalhandler; + +#ifdef WIN32 + HWND m_hWnd; +#else + int fdr; + int fdw; + GIOChannel* io_channel; + guint io_channel_watch_id; +#endif +}; + +#endif /* __SYNCHRONIZER__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/tls_tunnel.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/tls_tunnel.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/backends/xp/tls_tunnel.h 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/backends/xp/tls_tunnel.h 2008-07-13 13:05:21.000000000 +0100 @@ -0,0 +1,586 @@ +/* Copyright (C) 2008 AbiSource Corporation B.V. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef __TLS_TUNNEL_H__ +#define __TLS_TUNNEL_H__ + +#ifndef WIN32 +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define return_val_if_neg(C, val) { if (C < 0) {return val;} } + +namespace tls_tunnel { + +#define MIN_CLIENT_PORT 50000 +#define MAX_CLIENT_PORT 50100 + +#define TUNNEL_BUFFER_SIZE 4096 +#define LOCAL_BUFFER_SIZE 4096 + +#define TRANSPORT_ERROR "Transport exception: " +#define TLS_SETUP_ERROR "Error setting up TLS connection" +#define TLS_CREDENTIALS_ERROR "Error setting up TLS connection" +#define TLS_VERIFY_PEER_ERROR "Error verifying peer" +#define TLS_VERIFY_HOSTNAME_ERROR "Error verifying hostname" +#define TLS_CANT_GET_PEER_CERT_ERROR "Failed to get peer certificate" + +typedef boost::shared_ptr socket_ptr_t; +typedef boost::shared_ptr session_ptr_t; + +class mutex { +public: + mutex() { +#ifdef WIN32 + repr = CreateMutex(0, FALSE, 0); +#else + pthread_mutex_init(&repr, NULL); +#endif + } + + void lock() { +#ifdef WIN32 + WaitForSingleObject(repr, INFINITE); +#else + pthread_mutex_lock(&repr); +#endif + } + + void unlock() { +#ifdef WIN32 + ReleaseMutex(repr); +#else + pthread_mutex_unlock(&repr); +#endif + } + + ~mutex() + { +#ifdef WIN32 + CloseHandle(repr); +#else + pthread_mutex_destroy(&repr); +#endif + } + +private: + mutex( const mutex& ); + const mutex& operator=( const mutex& ); + +#ifdef WIN32 + HANDLE repr; +#else + pthread_mutex_t repr; +#endif +}; + +static int gcry_tunnel_mutex_init(void **priv) +{ + if (!priv) + return -1; + *priv = new mutex(); + return 0; +} + +static int gcry_tunnel_mutex_destroy(void **priv) +{ + if (!priv || !*priv) + return -1; + delete reinterpret_cast(*priv); + return 0; +} + +static int gcry_tunnel_mutex_lock(void **priv) +{ + reinterpret_cast(*priv)->lock(); + return 0; +} + +static int gcry_tunnel_mutex_unlock(void **priv) +{ + reinterpret_cast(*priv)->unlock(); + return 0; +} + +static struct gcry_thread_cbs gcry_threads_tunnel = +{ GCRY_THREAD_OPTION_USER, NULL, + gcry_tunnel_mutex_init, gcry_tunnel_mutex_destroy, + gcry_tunnel_mutex_lock, gcry_tunnel_mutex_unlock, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; + +static bool tls_tunnel_init() { + if (gcry_control(GCRYCTL_SET_THREAD_CBS, &tls_tunnel::gcry_threads_tunnel) != 0) + return false; + if (gnutls_global_init() != 0) + return false; + return true; +} + +static void tls_tunnel_deinit() { + gnutls_global_deinit(); +} + +class Exception { +public: + Exception(const std::string& message) + : message_(message) + { + } + + const std::string& message() const { + return message_; + } + +private: + std::string message_; +}; + +// private class; should't be in the public api +class _SessionPtrDestuctor { +public: + void operator()(gnutls_session_t* session) { + if (!session || !*session) + return; + gnutls_deinit(*session); + delete session; + } +}; + +class Transport { +public: + asio::io_service& io_service() { + return io_service_; + } + + void run() { + asio::error_code ec; + io_service_.run(ec); + } + + void stop() { + io_service_.stop(); + } + +protected: + Transport() + : io_service_(), + work_(io_service_) + { + } + +private: + asio::io_service io_service_; + asio::io_service::work work_; +}; + +class ClientTransport : public Transport { +public: + ClientTransport(const std::string& host, unsigned short port, boost::function on_connect) + : Transport(), + host_(host), + port_(port), + on_connect_(on_connect) + { + } + + void connect() { + asio::ip::tcp::resolver resolver(io_service()); + asio::ip::tcp::resolver::query query(host_, boost::lexical_cast(port_)); + asio::ip::tcp::resolver::iterator iterator(resolver.resolve(query)); + socket_ptr_t socket_ptr(new asio::ip::tcp::socket(io_service())); + socket_ptr->connect(*iterator); + on_connect_(socket_ptr); + } + +private: + std::string host_; + unsigned short port_; + boost::function on_connect_; +}; + + +class ServerTransport : public Transport { +public: + ServerTransport(const std::string& ip, unsigned short port, boost::function on_connect) + : Transport(), + acceptor_(io_service(), asio::ip::tcp::endpoint(asio::ip::address_v4::from_string(ip), port)), + on_connect_(on_connect) + { + } + + void accept() { + socket_ptr_t socket_ptr(new asio::ip::tcp::socket(io_service())); + acceptor_.async_accept(*socket_ptr, boost::bind(&ServerTransport::on_accept, this, asio::placeholders::error, socket_ptr)); + } + +private: + void on_accept(const asio::error_code& error, socket_ptr_t socket_ptr) { + if (error) { + return; + } + on_connect_(socket_ptr); + accept(); + } + + asio::ip::tcp::acceptor acceptor_; + boost::function on_connect_; +}; + +static ssize_t read(gnutls_transport_ptr_t ptr, void* buffer, size_t size) { + asio::ip::tcp::socket* socket = reinterpret_cast(ptr); + try { + return asio::read(*socket, asio::buffer(buffer, size)); + } catch (asio::system_error& se) { + return -1; + } +} + +static ssize_t write(gnutls_transport_ptr_t ptr, const void* buffer, size_t size) { + asio::ip::tcp::socket* socket = reinterpret_cast(ptr); + try { + return asio::write(*socket, asio::buffer(buffer, size)); + } catch (asio::system_error& se) { + return -1; + } +} + +class Proxy { +public: + virtual ~Proxy() { + gnutls_certificate_free_credentials(x509cred); + } + + void run() { + transport().run(); + } + + void stop() { + transport().stop(); + } + + virtual Transport& transport() = 0; + +protected: + Proxy(const std::string& ca_file) + : tunnel_buffer(TUNNEL_BUFFER_SIZE), + local_buffer(LOCAL_BUFFER_SIZE) + { + // setup certificates + if (gnutls_certificate_allocate_credentials(&x509cred) < 0) + throw Exception(TLS_SETUP_ERROR); + if (gnutls_certificate_set_x509_trust_file(x509cred, ca_file.c_str(), GNUTLS_X509_FMT_PEM) < 0) + throw Exception(TLS_SETUP_ERROR); + } + + void on_local_read(const asio::error_code& error, std::size_t bytes_transferred, + session_ptr_t session_ptr, socket_ptr_t local_socket_ptr, socket_ptr_t remote_socket_ptr) { + if (error) { + disconnect_(session_ptr, local_socket_ptr, remote_socket_ptr); + return; + } + + // write the data to the tunnel connection + if (gnutls_record_send(*session_ptr, &local_buffer[0], bytes_transferred) < 0) { + disconnect_(session_ptr, local_socket_ptr, remote_socket_ptr); + return; + } + + local_socket_ptr->async_receive( + asio::buffer(&local_buffer[0], local_buffer.size()), + boost::bind(&Proxy::on_local_read, this, asio::placeholders::error, asio::placeholders::bytes_transferred, + session_ptr, local_socket_ptr, remote_socket_ptr) + ); + } + + void tunnel(session_ptr_t session_ptr, socket_ptr_t local_socket_ptr, socket_ptr_t remote_socket_ptr) { + asio::thread thread(boost::bind(&Proxy::tunnel_, this, session_ptr, local_socket_ptr, remote_socket_ptr)); + } + + void disconnect_(session_ptr_t session_ptr, socket_ptr_t local_socket_ptr, socket_ptr_t remote_socket_ptr) { + // shutdown the tls session (ignore any error condition) + if (session_ptr) + gnutls_bye(*session_ptr, GNUTLS_SHUT_RDWR); + + // shutdown the sockets belonging to this tunnel + asio::error_code ec; + if (local_socket_ptr && local_socket_ptr->is_open()) { + local_socket_ptr->shutdown(asio::ip::tcp::socket::shutdown_both, ec); + local_socket_ptr->close(ec); + } + + if (remote_socket_ptr && remote_socket_ptr->is_open()) { + remote_socket_ptr->shutdown(asio::ip::tcp::socket::shutdown_both, ec); + remote_socket_ptr->close(ec); + } + } + + gnutls_certificate_credentials_t x509cred; + +private: + void tunnel_(session_ptr_t session_ptr, socket_ptr_t local_socket_ptr, socket_ptr_t remote_socket_ptr) { + local_socket_ptr->async_receive( + asio::buffer(&local_buffer[0], local_buffer.size()), + boost::bind(&Proxy::on_local_read, this, asio::placeholders::error, asio::placeholders::bytes_transferred, + session_ptr, local_socket_ptr, remote_socket_ptr) + ); + + ssize_t bytes_transferred = 0; + while (true) { + bytes_transferred = gnutls_record_recv(*session_ptr, &tunnel_buffer[0], tunnel_buffer.size()); + + if (bytes_transferred == 0) + break; + + // TODO: check return code properly? + if (bytes_transferred < 0) + break; + + // forward the data over the local connection + try { + asio::write(*local_socket_ptr, asio::buffer(&tunnel_buffer[0], bytes_transferred)); + } catch (asio::system_error& se) { + break; + } + } + + disconnect_(session_ptr, local_socket_ptr, remote_socket_ptr); + } + + std::vector tunnel_buffer; + std::vector local_buffer; +}; + +static const int PRIORITIES[] = { GNUTLS_KX_ANON_DH, GNUTLS_KX_RSA, GNUTLS_KX_DHE_DSS, GNUTLS_KX_DHE_RSA, 0 }; +static const int CIPHERS[] = { GNUTLS_CIPHER_AES_256_CBC, GNUTLS_CIPHER_AES_128_CBC, GNUTLS_CIPHER_3DES_CBC, GNUTLS_CIPHER_ARCFOUR_128, 0 }; + +// FIXME: this clientproxy can only handle 1 SSL connection at the same time +class ClientProxy : public Proxy { +public: + ClientProxy(const std::string& connect_address, unsigned short connect_port, + const std::string& ca_file, bool check_hostname) + try + : Proxy(ca_file), + transport_(connect_address, connect_port, boost::bind(&ClientProxy::on_transport_connect, this, _1)), + local_address_("127.0.0.1"), + local_port_(0), + connect_address_(connect_address), + acceptor_ptr(), + check_hostname_(check_hostname) + { + for (unsigned short port = MIN_CLIENT_PORT; port <= MAX_CLIENT_PORT; port++) { + try { + acceptor_ptr.reset(new asio::ip::tcp::acceptor(transport_.io_service(), asio::ip::tcp::endpoint(asio::ip::address_v4::from_string(local_address_), port))); + local_port_ = port; + break; + } catch (asio::system_error& se) { + if (port == MAX_CLIENT_PORT) + throw se; + if (se.code() != asio::error::address_in_use) + throw se; + // this port is already in use, try another one + continue; + } + } + transport_.connect(); + } catch (asio::system_error& se) { + throw Exception(std::string(TRANSPORT_ERROR) + se.what()); + } + + const std::string& local_address() const { + return local_address_; + } + + unsigned short local_port() const { + return local_port_; + } + +private: + Transport& transport() { + return static_cast(transport_); + } + + void on_transport_connect(socket_ptr_t remote_socket_ptr) { + session_ptr_t session_ptr = setup_tls_session(remote_socket_ptr); + if (!session_ptr) { + disconnect_(session_ptr_t(), socket_ptr_t(), remote_socket_ptr); + throw Exception(TLS_SETUP_ERROR); + } + + // start accepting connections on the local socket + socket_ptr_t local_socket_ptr(new asio::ip::tcp::socket(transport_.io_service())); + acceptor_ptr->async_accept(*local_socket_ptr, boost::bind(&ClientProxy::on_client_connect, this, + asio::placeholders::error, session_ptr, local_socket_ptr, remote_socket_ptr)); + } + + void on_client_connect(const asio::error_code& error, + session_ptr_t session_ptr, socket_ptr_t local_socket_ptr, socket_ptr_t remote_socket_ptr) { + if (error) { + disconnect_(session_ptr, local_socket_ptr, remote_socket_ptr); + return; + } + tunnel(session_ptr, local_socket_ptr, remote_socket_ptr); + } + + session_ptr_t setup_tls_session(socket_ptr_t remote_socket_ptr) { + session_ptr_t session_ptr(new gnutls_session_t(), _SessionPtrDestuctor()); + + // setup session + return_val_if_neg(gnutls_init(session_ptr.get(), GNUTLS_CLIENT), session_ptr_t()); + return_val_if_neg(gnutls_set_default_priority(*session_ptr), session_ptr_t()); + return_val_if_neg(gnutls_kx_set_priority(*session_ptr,PRIORITIES), session_ptr_t()); + return_val_if_neg(gnutls_cipher_set_priority(*session_ptr,CIPHERS), session_ptr_t()); + return_val_if_neg(gnutls_credentials_set(*session_ptr, GNUTLS_CRD_CERTIFICATE, x509cred), session_ptr_t()); + + // setup transport + gnutls_transport_set_pull_function(*session_ptr,tls_tunnel::read); + gnutls_transport_set_push_function(*session_ptr,tls_tunnel::write); + gnutls_transport_set_ptr(*session_ptr, remote_socket_ptr.get()); + + // handshake + return_val_if_neg(gnutls_handshake(*session_ptr), session_ptr_t()); + + // verify peer + unsigned int status; + if (gnutls_certificate_verify_peers2(*session_ptr, &status) != 0) + throw Exception(TLS_VERIFY_PEER_ERROR); + + gnutls_x509_crt cert; + const gnutls_datum* cert_list; + unsigned int cert_list_size; + + // check hostname + return_val_if_neg(gnutls_x509_crt_init(&cert), session_ptr_t()); + cert_list = gnutls_certificate_get_peers(*session_ptr, &cert_list_size); + if (!cert_list) + throw Exception(TLS_CANT_GET_PEER_CERT_ERROR); + + return_val_if_neg(gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER), session_ptr_t()); + char name[256] = {0}; + size_t namesize = sizeof(name); + return_val_if_neg(gnutls_x509_crt_get_dn(cert, name, &namesize), session_ptr_t()); + if (check_hostname_ && gnutls_x509_crt_check_hostname(cert, connect_address_.c_str()) == 0) + throw Exception(TLS_VERIFY_HOSTNAME_ERROR); + + return session_ptr; + } + + ClientTransport transport_; + std::string local_address_; + unsigned short local_port_; + std::string connect_address_; + boost::shared_ptr acceptor_ptr; + bool check_hostname_; +}; + +class ServerProxy : public Proxy { +public: + ServerProxy(const std::string& bind_ip, unsigned short bind_port, unsigned short local_port, + const std::string& ca_file, const std::string& cert_file, const std::string& key_file) + try + : Proxy(ca_file), + transport_(bind_ip, bind_port, boost::bind(&ServerProxy::on_transport_connect, this, _1)), + local_port_(local_port) + { + // setup tls server state + if (gnutls_certificate_set_x509_key_file (x509cred, cert_file.c_str(), key_file.c_str(), GNUTLS_X509_FMT_PEM) < 0) + throw Exception(TLS_SETUP_ERROR); + + if (gnutls_dh_params_init(&dh_params) < 0) + throw Exception(TLS_SETUP_ERROR); + + if (gnutls_dh_params_generate2(dh_params, 1024) < 0) + throw Exception(TLS_SETUP_ERROR); + + gnutls_certificate_set_dh_params(x509cred, dh_params); + + // start accepting connections + transport_.accept(); + } catch (asio::system_error& se) { + throw Exception(std::string(TRANSPORT_ERROR) + se.what()); + } + +private: + Transport& transport() { + return static_cast(transport_); + } + + void on_transport_connect(socket_ptr_t remote_socket_ptr) { + session_ptr_t session_ptr = setup_tls_session(remote_socket_ptr); + if (!session_ptr) { + disconnect_(session_ptr_t(), socket_ptr_t(), remote_socket_ptr); + return; + } + + socket_ptr_t local_socket_ptr(new asio::ip::tcp::socket(transport_.io_service())); + try { + asio::ip::tcp::resolver resolver(transport_.io_service()); + asio::ip::tcp::resolver::query query("127.0.0.1", boost::lexical_cast(local_port_)); + asio::ip::tcp::resolver::iterator iterator(resolver.resolve(query)); + local_socket_ptr->connect(*iterator); + } catch (asio::system_error& se) { + disconnect_(session_ptr, local_socket_ptr, remote_socket_ptr); + return; + } + + tunnel(session_ptr, local_socket_ptr, remote_socket_ptr); + } + + session_ptr_t setup_tls_session(socket_ptr_t remote_socket_ptr) { + session_ptr_t session_ptr(new gnutls_session_t()); + + // setup session + return_val_if_neg(gnutls_init(session_ptr.get(), GNUTLS_SERVER), session_ptr_t()); + return_val_if_neg(gnutls_set_default_priority(*session_ptr), session_ptr_t()); + return_val_if_neg(gnutls_credentials_set(*session_ptr, GNUTLS_CRD_CERTIFICATE, x509cred), session_ptr_t()); + gnutls_certificate_server_set_request(*session_ptr,GNUTLS_CERT_REQUEST); + gnutls_dh_set_prime_bits(*session_ptr, 1024); + + // setup ssl transport + gnutls_transport_set_pull_function(*session_ptr, tls_tunnel::read); + gnutls_transport_set_push_function(*session_ptr, tls_tunnel::write); + gnutls_transport_set_ptr(*session_ptr, remote_socket_ptr.get()); + + // execute ssl handshake + gnutls_certificate_server_set_request(*session_ptr, GNUTLS_CERT_REQUEST); + return_val_if_neg(gnutls_handshake(*session_ptr), session_ptr_t()); + + return session_ptr; + } + + ServerTransport transport_; + unsigned short local_port_; + + gnutls_dh_params_t dh_params; +}; + +} /* namespace tls_tunnel */ + +#endif /* __TLS_TUNNEL_H__ */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/GNUmakefile.in 2008-04-06 22:37:39.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/GNUmakefile.in 2008-07-13 14:10:00.000000000 +0100 @@ -66,6 +66,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/Makefile 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/Makefile 2008-07-13 13:05:14.000000000 +0100 @@ -26,7 +26,7 @@ DIRS= xp win -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationAccounts.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationAccounts.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationAccounts.cpp 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationAccounts.cpp 2008-07-13 13:05:12.000000000 +0100 @@ -310,8 +310,8 @@ pHandler->getDisplayType().utf8_str() )); - AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); - pManager->destroyAccount(pHandler); + _deleteAccount(pHandler); + // for now, recreate the whole model; but we should really just delete // the iter we got above _setModel(_constructModel()); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.cpp 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.cpp 2008-07-13 13:05:12.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 2006,2007 by Marc Maurer +/* Copyright (C) 2006-2008 by Marc Maurer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -32,7 +32,7 @@ enum { DESCRIPTION_COLUMN = 0, - JOINED_COLUMN, + CONNECTED_COLUMN, DOCHANDLE_COLUMN, BUDDY_COLUMN, VISIBLE_COLUMN, @@ -49,6 +49,23 @@ dlg->eventRefresh(); } +static void s_connect_clicked(GtkWidget * wid, AP_UnixDialog_CollaborationJoin * dlg) +{ + dlg->eventConnect(); +} + +static void s_disconnect_clicked(GtkWidget * wid, AP_UnixDialog_CollaborationJoin * dlg) +{ + dlg->eventDisconnect(); +} + +static void s_selection_changed(GtkTreeView *treeview, AP_UnixDialog_CollaborationJoin * dlg) +{ + UT_return_if_fail(treeview && dlg); + dlg->eventSelectionChanged(treeview); +} + +/* static void joined_toggled (GtkCellRendererToggle *cell, gchar *path_str, gpointer data) @@ -64,14 +81,14 @@ // get the toggled state gtk_tree_model_get_iter (model, &iter, path); - gtk_tree_model_get (model, &iter, JOINED_COLUMN, &joined, -1); + gtk_tree_model_get (model, &iter, CONNECTED_COLUMN, &joined, -1); gtk_tree_model_get (model, &iter, DOCHANDLE_COLUMN, &doc_handle, -1); gtk_tree_model_get (model, &iter, BUDDY_COLUMN, &buddy, -1); // toggle the value joined = !joined; // set the new value - gtk_tree_store_set (GTK_TREE_STORE (model), &iter, JOINED_COLUMN, joined, -1); + gtk_tree_store_set (GTK_TREE_STORE (model), &iter, CONNECTED_COLUMN, joined, -1); // handle the joining/closing of the selected document pDlg->eventJoin( @@ -82,6 +99,7 @@ // clean up gtk_tree_path_free (path); } +*/ XAP_Dialog * AP_UnixDialog_CollaborationJoin::static_constructor(XAP_DialogFactory * pFactory, XAP_Dialog_Id id) { @@ -95,7 +113,9 @@ m_wAddBuddy(NULL), m_wDeleteBuddy(NULL), m_wModel(NULL), - m_wBuddyTree(NULL) + m_wBuddyTree(NULL), + m_wConnect(NULL), + m_wDisconnect(NULL) { } @@ -115,12 +135,18 @@ switch ( abiRunModalDialog ( GTK_DIALOG(m_wWindowMain), pFrame, this, GTK_RESPONSE_CLOSE, false ) ) { - /*case GTK_RESPONSE_CLOSE: - m_answer = AP_UnixDialog_CollaborationAccounts::a_CLOSE; + case GTK_RESPONSE_YES: // ugly stock response abuse + m_answer = AP_Dialog_CollaborationJoin::a_CONNECT; + break; + case GTK_RESPONSE_NO: // ugly stock response abuse + m_answer = AP_Dialog_CollaborationJoin::a_DISCONNECT; + break; + case GTK_RESPONSE_CLOSE: + m_answer = AP_Dialog_CollaborationJoin::a_CLOSE; break; default: - m_answer = AP_UnixDialog_CollaborationAccounts::a_CLOSE; - break;*/ + m_answer = AP_Dialog_CollaborationJoin::a_CLOSE; + break; } abiDestroyWidget(m_wWindowMain); @@ -148,12 +174,16 @@ m_wDeleteBuddy = glade_xml_get_widget(xml, "btDeleteBuddy"); m_wRefresh = glade_xml_get_widget(xml, "btRefresh"); m_wBuddyTree = glade_xml_get_widget(xml, "tvBuddies"); - + m_wConnect = glade_xml_get_widget(xml, "btConnect"); + m_wDisconnect = glade_xml_get_widget(xml, "btDisconnect"); + _refreshAccounts(); AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); gtk_widget_set_sensitive(m_wAddBuddy, pManager->getAccounts().getItemCount() != 0); // TODO: fix this gtk_widget_set_sensitive(m_wDeleteBuddy, false); // TODO: implement this gtk_widget_set_sensitive(m_wRefresh, true); + gtk_widget_set_sensitive(m_wConnect, false); + gtk_widget_set_sensitive(m_wDisconnect, false); // set the dialog title // TODO @@ -171,6 +201,21 @@ "clicked", G_CALLBACK(s_refresh_clicked), static_cast(this)); + + g_signal_connect(G_OBJECT(m_wConnect), + "clicked", + G_CALLBACK(s_connect_clicked), + static_cast(this)); + + g_signal_connect(G_OBJECT(m_wDisconnect), + "clicked", + G_CALLBACK(s_disconnect_clicked), + static_cast(this)); + + g_signal_connect_after(G_OBJECT(m_wBuddyTree), + "cursor-changed", + G_CALLBACK(s_selection_changed), + static_cast(this)); return window; } @@ -201,11 +246,11 @@ renderer = gtk_cell_renderer_toggle_new (); g_object_set (renderer, "xalign", 0.0, NULL); - g_signal_connect (renderer, "toggled", G_CALLBACK (joined_toggled), this); + //g_signal_connect (renderer, "toggled", G_CALLBACK (joined_toggled), this); col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (m_wBuddyTree), - -1, "Joined", + -1, "Connected", renderer, - "active", JOINED_COLUMN, + "active", CONNECTED_COLUMN, "visible", VISIBLE_COLUMN, (void*)NULL); column = gtk_tree_view_get_column (GTK_TREE_VIEW (m_wBuddyTree), col_offset - 1); @@ -235,11 +280,12 @@ for (UT_uint32 j = 0; j < accounts.getNthItem(i)->getBuddies().size(); j++) { const Buddy* pBuddy = accounts.getNthItem(i)->getBuddies()[j]; - + UT_continue_if_fail(pBuddy); + gtk_tree_store_append (model, &iter, NULL); gtk_tree_store_set (model, &iter, DESCRIPTION_COLUMN, pBuddy->getDescription().utf8_str(), - JOINED_COLUMN, false, /* joined */ + CONNECTED_COLUMN, false, /* joined */ DOCHANDLE_COLUMN, 0, /* dochandle */ BUDDY_COLUMN, 0, /* buddy */ VISIBLE_COLUMN, false, /* visibility */ @@ -249,22 +295,18 @@ GtkTreeIter child_iter; for (const DocTreeItem* item = pBuddy->getDocTreeItems(); item; item = item->m_next) { - if (item->m_docHandle) - { - UT_DEBUGMSG(("DocHandle document name: %s\n", item->m_docHandle->getName().utf8_str())); + UT_continue_if_fail(item->m_docHandle); + UT_DEBUGMSG(("DocHandle document name: %s\n", item->m_docHandle->getName().utf8_str())); - // TODO: handle the DocTreeItem type - gtk_tree_store_append (model, &child_iter, &iter); - gtk_tree_store_set (model, &child_iter, - DESCRIPTION_COLUMN, (item->m_docHandle ? item->m_docHandle->getName().utf8_str() : "null"), - JOINED_COLUMN, pManager->isActive(item->m_docHandle->getSessionId()), - DOCHANDLE_COLUMN, item->m_docHandle, - BUDDY_COLUMN, pBuddy, - VISIBLE_COLUMN, true, - -1); - } - else - UT_ASSERT(UT_SHOULD_NOT_HAPPEN); + // TODO: handle the DocTreeItem type + gtk_tree_store_append (model, &child_iter, &iter); + gtk_tree_store_set (model, &child_iter, + DESCRIPTION_COLUMN, (item->m_docHandle ? item->m_docHandle->getName().utf8_str() : "null"), + CONNECTED_COLUMN, pManager->isActive(item->m_docHandle->getSessionId()), + DOCHANDLE_COLUMN, item->m_docHandle, + BUDDY_COLUMN, pBuddy, + VISIBLE_COLUMN, true, + -1); } } } @@ -307,15 +349,121 @@ _refreshAllDocHandlesAsync(); } -void AP_UnixDialog_CollaborationJoin::eventJoin(Buddy* pBuddy, DocHandle* pDocHandle, bool joined) +// FIXME: share code with eventDisconnect() +void AP_UnixDialog_CollaborationJoin::eventConnect() +{ + UT_DEBUGMSG(("AP_UnixDialog_CollaborationJoin::eventConnect()\n")); + + GtkTreeSelection * selection; + GtkTreeIter iter; + GtkTreeModel * model; + + selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_wBuddyTree) ); + if (!selection || !gtk_tree_selection_get_selected (selection, &model, &iter)) + { + m_answer = AP_Dialog_CollaborationJoin::a_CLOSE; + return; + } + + // see if we selected a row that has a document that we can still join + + // get the row data + gboolean connected; + gpointer doc_handle; + gpointer buddy; + + gtk_tree_model_get (model, &iter, CONNECTED_COLUMN, &connected, -1); + gtk_tree_model_get (model, &iter, DOCHANDLE_COLUMN, &doc_handle, -1); + gtk_tree_model_get (model, &iter, BUDDY_COLUMN, &buddy, -1); + + if (!doc_handle || connected) + { + UT_DEBUGMSG(("Not a document we can join\n")); + m_answer = AP_Dialog_CollaborationJoin::a_CLOSE; + return; + } + + UT_DEBUGMSG(("Got a document we can connect to!\n")); + m_answer = AP_Dialog_CollaborationJoin::a_CONNECT; + m_pBuddy = reinterpret_cast(buddy); + m_pDocHandle = reinterpret_cast(doc_handle); +} + +// FIXME: share code with eventConnect() +void AP_UnixDialog_CollaborationJoin::eventDisconnect() { - UT_DEBUGMSG(("AP_UnixDialog_CollaborationJoin::eventJoin()\n")); - UT_return_if_fail(pBuddy); - UT_return_if_fail(pDocHandle); - - if (joined) - _join(pBuddy, pDocHandle); - else - _disjoin(pBuddy, pDocHandle); + UT_DEBUGMSG(("AP_UnixDialog_CollaborationJoin::eventDisconnect()\n")); + + GtkTreeSelection * selection; + GtkTreeIter iter; + GtkTreeModel * model; + + selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_wBuddyTree) ); + if (!selection || !gtk_tree_selection_get_selected (selection, &model, &iter)) + { + m_answer = AP_Dialog_CollaborationJoin::a_CLOSE; + return; + } + + // see if we selected a row that has a document that we can still join + + // get the row data + gboolean connected; + gpointer doc_handle; + gpointer buddy; + + gtk_tree_model_get (model, &iter, CONNECTED_COLUMN, &connected, -1); + gtk_tree_model_get (model, &iter, DOCHANDLE_COLUMN, &doc_handle, -1); + gtk_tree_model_get (model, &iter, BUDDY_COLUMN, &buddy, -1); + + if (!doc_handle || !connected) + { + UT_DEBUGMSG(("Not a document we can disconnect from\n")); + m_answer = AP_Dialog_CollaborationJoin::a_CLOSE; + return; + } + + UT_DEBUGMSG(("Got a document we can disconnect from!\n")); + m_answer = AP_Dialog_CollaborationJoin::a_DISCONNECT; + m_pBuddy = reinterpret_cast(buddy); + m_pDocHandle = reinterpret_cast(doc_handle); } +void AP_UnixDialog_CollaborationJoin::eventSelectionChanged(GtkTreeView *treeview) +{ + UT_DEBUGMSG(("AP_UnixDialog_CollaborationJoin::eventSelectionChanged()\n")); + + GtkTreeSelection * selection; + GtkTreeIter iter; + GtkTreeModel * model; + + selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(treeview) ); + if (!selection || !gtk_tree_selection_get_selected (selection, &model, &iter)) + { + gtk_widget_set_sensitive(m_wConnect, false); + gtk_widget_set_sensitive(m_wDisconnect, false); + return; + } + + // see if we selected a row that has a document that we can still join + + // get the row data + gboolean connected; + gpointer doc_handle; + gpointer buddy; + + gtk_tree_model_get (model, &iter, CONNECTED_COLUMN, &connected, -1); + gtk_tree_model_get (model, &iter, DOCHANDLE_COLUMN, &doc_handle, -1); + gtk_tree_model_get (model, &iter, BUDDY_COLUMN, &buddy, -1); + + if (!doc_handle) + { + UT_DEBUGMSG(("Not a document\n")); + gtk_widget_set_sensitive(m_wConnect, false); + gtk_widget_set_sensitive(m_wDisconnect, false); + return; + } + + gtk_widget_set_sensitive(m_wConnect, !connected); + gtk_widget_set_sensitive(m_wDisconnect, connected); +} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.glade /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.glade --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.glade 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.glade 2008-07-13 13:05:12.000000000 +0100 @@ -6,8 +6,8 @@ 5 - 460 - 300 + 550 + 350 Join collaboration GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER @@ -35,6 +35,33 @@ GTK_BUTTONBOX_END + + True + True + True + True + gtk-disconnect + True + GTK_RELIEF_NORMAL + True + -9 + + + + + + True + True + True + gtk-connect + True + GTK_RELIEF_NORMAL + True + -8 + + + + True True diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.h 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/ap_UnixDialog_CollaborationJoin.h 2008-07-13 13:05:11.000000000 +0100 @@ -34,7 +34,9 @@ void eventAddBuddy(); void eventRefresh(); - void eventJoin(Buddy* pBuddy, DocHandle* pDocHandle, bool joined); + void eventConnect(); + void eventDisconnect(); + void eventSelectionChanged(GtkTreeView *treeview); GtkTreeStore* getModel() @@ -54,6 +56,8 @@ GtkWidget* m_wRefresh; GtkTreeStore* m_wModel; GtkWidget * m_wBuddyTree; + GtkWidget* m_wConnect; + GtkWidget* m_wDisconnect; }; #endif /* AP_UNIXDIALOG_COLLABORATIONJOIN_H */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/unix/GNUmakefile.in 2008-04-06 22:37:39.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/unix/GNUmakefile.in 2008-07-13 14:10:00.000000000 +0100 @@ -102,6 +102,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAccounts.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAccounts.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAccounts.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAccounts.cpp 2008-07-13 13:05:14.000000000 +0100 @@ -29,31 +29,35 @@ #include "ap_Win32Dialog_CollaborationAccounts.h" -static BOOL CALLBACK AP_Win32Dialog_CollaborationAccounts::s_dlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +BOOL CALLBACK AP_Win32Dialog_CollaborationAccounts::s_dlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - AP_Win32Dialog_CollaborationAccounts * pThis; switch (msg) { - case WM_INITDIALOG: - pThis = (AP_Win32Dialog_CollaborationAccounts *)lParam; - UT_return_val_if_fail(pThis, 0); - SetWindowLong(hWnd,DWL_USER,lParam); - return pThis->_onInitDialog(hWnd,wParam,lParam); - - case WM_COMMAND: - pThis = (AP_Win32Dialog_CollaborationAccounts *)GetWindowLong(hWnd,DWL_USER); - UT_return_val_if_fail(pThis, 0); - return pThis->_onCommand(hWnd,wParam,lParam); - - case WM_DESTROY: - pThis = (AP_Win32Dialog_CollaborationAccounts *)GetWindowLong(hWnd,DWL_USER); - DELETEP(pThis->p_win32Dialog); - return true; - - default: - // Message not processed - Windows should take care of it - return false; - } + case WM_INITDIALOG: + { + AP_Win32Dialog_CollaborationAccounts* pThis = (AP_Win32Dialog_CollaborationAccounts *)lParam; + UT_return_val_if_fail(pThis, false); + SetWindowLong(hWnd,DWL_USER,lParam); + return pThis->_onInitDialog(hWnd,wParam,lParam); + } + case WM_COMMAND: + { + AP_Win32Dialog_CollaborationAccounts* pThis = (AP_Win32Dialog_CollaborationAccounts *)GetWindowLong(hWnd,DWL_USER); + UT_return_val_if_fail(pThis, false); + return pThis->_onCommand(hWnd,wParam,lParam); + } + case WM_DESTROY: + { + UT_DEBUGMSG(("Got WM_DESTROY\n")); + AP_Win32Dialog_CollaborationAccounts* pThis = (AP_Win32Dialog_CollaborationAccounts *)GetWindowLong(hWnd,DWL_USER); + UT_return_val_if_fail(pThis, false); + DELETEP(pThis->m_pWin32Dialog); + return true; + } + default: + // Message not processed - Windows should take care of it + return false; + } } XAP_Dialog * AP_Win32Dialog_CollaborationAccounts::static_constructor(XAP_DialogFactory * pFactory, XAP_Dialog_Id id) @@ -64,7 +68,7 @@ AP_Win32Dialog_CollaborationAccounts::AP_Win32Dialog_CollaborationAccounts(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id) : AP_Dialog_CollaborationAccounts(pDlgFactory, id), - p_win32Dialog(NULL), + m_pWin32Dialog(NULL), m_hInstance(NULL) { AbiCollabSessionManager * pSessionManager= AbiCollabSessionManager::getManager(); @@ -76,31 +80,25 @@ void AP_Win32Dialog_CollaborationAccounts::runModal(XAP_Frame * pFrame) { - UT_return_if_fail(pFrame); UT_return_if_fail(m_hInstance); - XAP_Win32App* pWin32App = static_cast(XAP_App::getApp()); - // create the dialog LPCTSTR lpTemplate = MAKEINTRESOURCE(AP_RID_DIALOG_COLLABORATIONACCOUNTS); int result = DialogBoxParam( m_hInstance, lpTemplate, static_cast(pFrame->getFrameImpl())->getTopLevelWindow(), (DLGPROC)s_dlgProc, (LPARAM)this ); - switch (result) { - case 0: - // MSDN: If the function fails because the hWndParent parameter is invalid, the return value is zero. - break; - case -1: - UT_DEBUGMSG(("Win32 error: %d. lpTemplate: %d, RID:%d\n", GetLastError(), lpTemplate, AP_RID_DIALOG_COLLABORATIONACCOUNTS)); - - break; - default: - break; - // ok! + switch (result) + { + case 0: + // MSDN: If the function fails because the hWndParent parameter is invalid, the return value is zero. + break; + case -1: + UT_DEBUGMSG(("Win32 error: %d. lpTemplate: %d, RID:%d\n", GetLastError(), lpTemplate, AP_RID_DIALOG_COLLABORATIONACCOUNTS)); + break; + default: + break; }; - - } /*****************************************************************/ @@ -143,12 +141,12 @@ int index=0; std::map::iterator iter=model.begin(); std::map::iterator end=model.end(); - p_win32Dialog->resetContent(AP_RID_DIALOG_COLLABORATIONACCOUNTS_ACCOUNT_LIST); + m_pWin32Dialog->resetContent(AP_RID_DIALOG_COLLABORATIONACCOUNTS_ACCOUNT_LIST); m_mIndices.clear(); while (iter!=end) { - p_win32Dialog->addItemToList(AP_RID_DIALOG_COLLABORATIONACCOUNTS_ACCOUNT_LIST, AP_Win32App::s_fromUTF8ToWinLocale((iter->first).utf8_str()).c_str()); + m_pWin32Dialog->addItemToList(AP_RID_DIALOG_COLLABORATIONACCOUNTS_ACCOUNT_LIST, AP_Win32App::s_fromUTF8ToWinLocale((iter->first).utf8_str()).c_str()); m_mIndices[index]=(iter->second); iter++; index++; @@ -203,8 +201,8 @@ // hDlg is stored in the DialogHelper - use that! // Get ourselves a custom DialogHelper - DELETEP(p_win32Dialog); - p_win32Dialog = new XAP_Win32DialogHelper(hWnd); + DELETEP(m_pWin32Dialog); + m_pWin32Dialog = new XAP_Win32DialogHelper(hWnd); // Set up dialog initial state _setModel(_constructModel()); @@ -213,7 +211,7 @@ _updateSelection(); // Center Window - p_win32Dialog->centerDialog(); + m_pWin32Dialog->centerDialog(); return true; } @@ -223,9 +221,8 @@ { WORD wNotifyCode = HIWORD(wParam); WORD wId = LOWORD(wParam); - HWND hWndCtrl = (HWND)lParam; - int selItem; AccountHandler* pHandler; + switch (wId) { case AP_RID_DIALOG_COLLABORATIONACCOUNTS_CLOSE_BUTTON: @@ -282,8 +279,6 @@ createNewAccount(); // TODO: only refresh if it actually changed. _setModel(_constructModel()); - - // WM_COMMAND message processed return true; case AP_RID_DIALOG_COLLABORATIONACCOUNTS_DELETE_BUTTON: @@ -310,8 +305,7 @@ _setModel(_constructModel()); } } - - // WM_COMMAND message processed + return true; case AP_RID_DIALOG_COLLABORATIONACCOUNTS_PROPERTIES_BUTTON: @@ -322,28 +316,25 @@ // TODO: do something like open a dialog. } - // we didn't really handle anything - return false; + return true; default: // WM_COMMAND message NOT processed return false; - } - - + } } void AP_Win32Dialog_CollaborationAccounts::_updateSelection() { - int selItem = p_win32Dialog->getListSelectedIndex(AP_RID_DIALOG_COLLABORATIONACCOUNTS_ACCOUNT_LIST); + int selItem = m_pWin32Dialog->getListSelectedIndex(AP_RID_DIALOG_COLLABORATIONACCOUNTS_ACCOUNT_LIST); if (selItem != LB_ERR) { m_bHasSelection = true; m_iSelected = selItem; // TODO: Uncomment this line when Preferences does something. - //p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_PROPERTIES_BUTTON, true); + //m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_PROPERTIES_BUTTON, true); - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DELETE_BUTTON, true); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DELETE_BUTTON, true); // Choose which of the Connect/Disconnect buttons is available AccountHandler* pHandler; pHandler=m_mIndices[m_iSelected]; @@ -352,30 +343,30 @@ if (pHandler->isOnline()) { // We're online with this account - allow disconnect. - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_CONNECT_BUTTON, false); - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DISCONNECT_BUTTON, true); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_CONNECT_BUTTON, false); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DISCONNECT_BUTTON, true); } else { // We're offline - allow connect - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_CONNECT_BUTTON, true); - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DISCONNECT_BUTTON, false); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_CONNECT_BUTTON, true); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DISCONNECT_BUTTON, false); } } else { // pHandler no good - don't allow connect or disconnect - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_CONNECT_BUTTON, false); - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DISCONNECT_BUTTON, false); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_CONNECT_BUTTON, false); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DISCONNECT_BUTTON, false); } } else { m_bHasSelection = false; - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_PROPERTIES_BUTTON, false); - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DELETE_BUTTON, false); - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_CONNECT_BUTTON, false); - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DISCONNECT_BUTTON, false); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_PROPERTIES_BUTTON, false); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DELETE_BUTTON, false); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_CONNECT_BUTTON, false); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONACCOUNTS_DISCONNECT_BUTTON, false); } } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAccounts.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAccounts.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAccounts.h 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAccounts.h 2008-07-13 13:05:13.000000000 +0100 @@ -44,14 +44,12 @@ virtual void signal(const Event& event, const Buddy* pSource); private: - XAP_Win32DialogHelper * p_win32Dialog; - std::map _constructModel(); void _setModel(std::map model); void setOnline(AccountHandler* pHandler, bool online); void _updateSelection(); - // Handles + XAP_Win32DialogHelper * m_pWin32Dialog; HINSTANCE m_hInstance; // Internal states diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAddAccount.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAddAccount.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAddAccount.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAddAccount.cpp 2008-07-13 13:05:13.000000000 +0100 @@ -1,6 +1,6 @@ /* AbiCollab - Code to enable the modification of remote documents. * Copyright (C) 2007 by Ryan Pavlik - * Copyright (C) 2006 by Marc Maurer + * Copyright (C) 2006,2008 by Marc Maurer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,54 +30,37 @@ #include "ap_Win32Dialog_CollaborationAddAccount.h" -static BOOL CALLBACK AP_Win32Dialog_CollaborationAddAccount::s_dlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +BOOL CALLBACK AP_Win32Dialog_CollaborationAddAccount::s_dlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - AP_Win32Dialog_CollaborationAddAccount * pThis; switch (msg) { - case WM_INITDIALOG: - pThis = (AP_Win32Dialog_CollaborationAddAccount *)lParam; - UT_return_val_if_fail(pThis, 0); - SetWindowLong(hWnd,DWL_USER,lParam); - return pThis->_onInitDialog(hWnd,wParam,lParam); - - case WM_COMMAND: - pThis = (AP_Win32Dialog_CollaborationAddAccount *)GetWindowLong(hWnd,DWL_USER); - UT_return_val_if_fail(pThis, 0); - return pThis->_onCommand(hWnd,wParam,lParam); - - case WM_DESTROY: - pThis = (AP_Win32Dialog_CollaborationAddAccount *)GetWindowLong(hWnd,DWL_USER); - if (pThis->p_win32Dialog) + case WM_INITDIALOG: { - DELETEP(pThis->p_win32Dialog); + AP_Win32Dialog_CollaborationAddAccount* pThis = (AP_Win32Dialog_CollaborationAddAccount *)lParam; + UT_return_val_if_fail(pThis, false); + SetWindowLong(hWnd,DWL_USER,lParam); + return pThis->_onInitDialog(hWnd,wParam,lParam); } - return 0; - - case WM_NOTIFY: - pThis = (AP_Win32Dialog_CollaborationAddAccount *)GetWindowLong(hWnd,DWL_USER); - UT_return_val_if_fail(pThis, 0); - UT_return_val_if_fail(lParam, 0); - switch (((LPNMHDR)lParam)->code) + case WM_COMMAND: { - //case UDN_DELTAPOS: return pThis->_onDeltaPos((NM_UPDOWN *)lParam); - default: return 0; + AP_Win32Dialog_CollaborationAddAccount* pThis = (AP_Win32Dialog_CollaborationAddAccount *)GetWindowLong(hWnd,DWL_USER); + UT_return_val_if_fail(pThis, false); + return pThis->_onCommand(hWnd,wParam,lParam); } - - case WM_PARENTNOTIFY: - // do something here - messages for the backend gui might come in here - UT_DEBUGMSG(("WM_PARENTNOTIFY!\n")); - return false; - - return false; - - - default: - // Windows handles all unhandled messages - pass false - return false; - + case WM_DESTROY: + { + UT_DEBUGMSG(("Got WM_DESTROY\n")); + AP_Win32Dialog_CollaborationAddAccount* pThis = (AP_Win32Dialog_CollaborationAddAccount *)GetWindowLong(hWnd,DWL_USER); + UT_return_val_if_fail(pThis, false); + DELETEP(pThis->m_pWin32Dialog); + return true; + } + default: + // Message not processed - Windows should take care of it + return false; } } + XAP_Dialog * AP_Win32Dialog_CollaborationAddAccount::static_constructor(XAP_DialogFactory * pFactory, XAP_Dialog_Id id) { return static_cast(new AP_Win32Dialog_CollaborationAddAccount(pFactory, id)); @@ -86,10 +69,10 @@ AP_Win32Dialog_CollaborationAddAccount::AP_Win32Dialog_CollaborationAddAccount(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id) : AP_Dialog_CollaborationAddAccount(pDlgFactory, id), - p_win32Dialog(NULL), + m_pWin32Dialog(NULL), + m_hInstance(NULL), m_hOk(NULL), - m_hDetails(NULL), - m_hInstance(NULL) + m_hDetails(NULL) { AbiCollabSessionManager * pSessionManager = AbiCollabSessionManager::getManager(); if (pSessionManager) @@ -101,28 +84,25 @@ void AP_Win32Dialog_CollaborationAddAccount::runModal(XAP_Frame * pFrame) { - UT_return_if_fail(pFrame); UT_return_if_fail(m_hInstance); - XAP_Win32App* pWin32App = static_cast(XAP_App::getApp()); - + // create the dialog LPCTSTR lpTemplate = MAKEINTRESOURCE(AP_RID_DIALOG_COLLABORATIONADDACCOUNT); int result = DialogBoxParam( m_hInstance, lpTemplate, static_cast(pFrame->getFrameImpl())->getTopLevelWindow(), (DLGPROC)s_dlgProc, (LPARAM)this ); - switch (result) { - case 0: - // MSDN: If the function fails because the hWndParent parameter is invalid, the return value is zero. - break; - case -1: - UT_DEBUGMSG(("Win32 error: %d. lpTemplate: %d, RID:%d\n", GetLastError(), lpTemplate, AP_RID_DIALOG_COLLABORATIONADDACCOUNT)); - break; - default: - break; - // ok! + switch (result) + { + case 0: + // MSDN: If the function fails because the hWndParent parameter is invalid, the return value is zero. + break; + case -1: + UT_DEBUGMSG(("Win32 error: %d. lpTemplate: %d, RID:%d\n", GetLastError(), lpTemplate, AP_RID_DIALOG_COLLABORATIONADDACCOUNT)); + break; + default: + break; }; - //*/ } /*****************************************************************/ @@ -143,28 +123,28 @@ ////// // Get ourselves a custom DialogHelper - if (p_win32Dialog) + if (m_pWin32Dialog) { - DELETEP(p_win32Dialog); + DELETEP(m_pWin32Dialog); } - p_win32Dialog = new XAP_Win32DialogHelper(hWnd); + m_pWin32Dialog = new XAP_Win32DialogHelper(hWnd); ////// // Set up dialog initial state _populateWindowData(); // Center Window - p_win32Dialog->centerDialog(); + m_pWin32Dialog->centerDialog(); // Return 1 to proceed with dialog initialization return 1; } +// return true if we process the command, false otherwise BOOL AP_Win32Dialog_CollaborationAddAccount::_onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { WORD wNotifyCode = HIWORD(wParam); WORD wId = LOWORD(wParam); - HWND hWndCtrl = (HWND)lParam; AccountHandler* pHandler; switch (wId) @@ -184,14 +164,9 @@ else UT_DEBUGMSG(("No account handler types to select; this makes abicollab kinda pointless...\n")); - // WM_COMMAND message processed - return 0 - return 0; - } - else - { - // return unhandled - return 1; + return true; } + return false; case AP_RID_DIALOG_COLLABORATIONADDACCOUNT_OK_BUTTON: UT_DEBUGMSG(("Add Account - OK button clicked\n")); @@ -201,65 +176,58 @@ pHandler->storeProperties(); m_answer=AP_Dialog_CollaborationAddAccount::a_OK; EndDialog(hWnd,0); - - // WM_COMMAND message processed - return 0 - return 0; + return true; + case AP_RID_DIALOG_COLLABORATIONADDACCOUNT_CANCEL_BUTTON: // Close without applying changes EndDialog(hWnd,0); m_answer=AP_Dialog_CollaborationAddAccount::a_CANCEL; - - // WM_COMMAND message processed - return 0 - return 0; + return true; + default: - - AccountHandler* pAccountHandler=_getActiveAccountHandler(); + AccountHandler* pAccountHandler = _getActiveAccountHandler(); if (pAccountHandler) //if we have an account handler { return pAccountHandler->_onCommand(hWnd, wParam, lParam); } - // return unhandled - return 1; + // WM_COMMAND message NOT processed + return false; } - - } void AP_Win32Dialog_CollaborationAddAccount::_populateWindowData() { - // populate the account type combobox + UT_DEBUGMSG(("AP_Win32Dialog_CollaborationAddAccount::_populateWindowData()\n")); + AbiCollabSessionManager* pSessionManager = AbiCollabSessionManager::getManager(); UT_return_if_fail(pSessionManager); - UT_sint32 index; - for (UT_sint32 i = 0; i < pSessionManager->getRegisteredAccountHandlers().size(); i++) + + UT_return_if_fail(m_pWin32Dialog); + + for (UT_uint32 i = 0; i < pSessionManager->getRegisteredAccountHandlers().size(); i++) { AccountHandlerConstructor pConstructor = pSessionManager->getRegisteredAccountHandlers().getNthItem(i); - if (pConstructor) + UT_continue_if_fail(pConstructor); + + // TODO: we need to free these somewhere + AccountHandler* pHandler = pConstructor(); + UT_continue_if_fail(pHandler); + + UT_sint32 index = m_pWin32Dialog->addItemToCombo(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, (LPCSTR) AP_Win32App::s_fromUTF8ToWinLocale(pHandler->getDisplayType().utf8_str()).c_str()); + if (index >= 0) { - // TODO: we need to free these somewhere - AccountHandler* pHandler = pConstructor(); - if (pHandler) - { - index=p_win32Dialog->addItemToCombo(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, (LPCSTR) AP_Win32App::s_fromUTF8ToWinLocale(pHandler->getDisplayType().utf8_str()).c_str()); - if (index>=0) - { - // remember for later - m_mAccountTypeCombo[index]=pHandler; - } - else - { - // windows threw an error - // TODO - handle? - } - } + UT_DEBUGMSG(("Added handler to index %d\n", index)); + m_vAccountTypeCombo.insert(m_vAccountTypeCombo.begin()+index, pHandler); } + else + UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); } // if we have at least one account handler, then make sure the first one is selected if (pSessionManager->getRegisteredAccountHandlers().size() > 0) { - p_win32Dialog->selectComboItem(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, 0); + m_pWin32Dialog->selectComboItem(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, 0); // Note, this requires that the backends be alright with having their widgets destroyed before being created. // TCP does this, but I didn't add such code to any other backends yet. --RP 22 July 2007 UT_DEBUGMSG(("Add Account - New handler type selected\n")); @@ -277,20 +245,23 @@ { // nope, we don't have any account handler :'-( // Add a sample item to show that we can. Then, disable the box and the ok button - index=p_win32Dialog->addItemToCombo(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, (LPCSTR) "No Handlers!"); - p_win32Dialog->selectComboItem(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, 0); - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, false); - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_OK_BUTTON, false); + m_pWin32Dialog->addItemToCombo(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, (LPCSTR) "No Handlers!"); + m_pWin32Dialog->selectComboItem(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, 0); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO, false); + m_pWin32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_OK_BUTTON, false); } } AccountHandler* AP_Win32Dialog_CollaborationAddAccount::_getActiveAccountHandler() { - int index; - index=p_win32Dialog->getComboSelectedIndex(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO); - UT_return_val_if_fail(index >= 0, 0); - // check the return value of this function! If it's a null pointer, don't follow it! - return m_mAccountTypeCombo[index]; + UT_DEBUGMSG(("AP_Win32Dialog_CollaborationAddAccount::_getActiveAccountHandler()\n")); + UT_return_val_if_fail(m_pWin32Dialog, NULL); + + int index = m_pWin32Dialog->getComboSelectedIndex(AP_RID_DIALOG_COLLABORATIONADDACCOUNT_TYPECOMBO); + UT_return_val_if_fail(index >= 0 && index < static_cast(m_vAccountTypeCombo.size()), NULL); + + // check the return value of this function! + return m_vAccountTypeCombo[index]; } void AP_Win32Dialog_CollaborationAddAccount::setBackendValidity(bool valid) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAddAccount.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAddAccount.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAddAccount.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationAddAccount.h 2008-07-13 13:05:13.000000000 +0100 @@ -21,7 +21,7 @@ #ifndef AP_WIN32DIALOG_COLLABORATIONADDACCOUNT_H #define AP_WIN32DIALOG_COLLABORATIONADDACCOUNT_H -#include +#include #include "xap_Win32DialogHelper.h" #include "ut_assert.h" @@ -44,7 +44,7 @@ void setBackendValidity(bool valid); protected: - XAP_Win32DialogHelper * p_win32Dialog; + XAP_Win32DialogHelper * m_pWin32Dialog; /* virtual void* _getEmbeddingParent() { return m_hDlg; } @@ -61,7 +61,7 @@ HWND m_hDetails; // Data - std::map m_mAccountTypeCombo; + std::vector m_vAccountTypeCombo; private: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationJoin.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationJoin.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationJoin.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationJoin.cpp 2008-07-13 13:05:14.000000000 +0100 @@ -32,7 +32,7 @@ #include "ap_Win32Dialog_CollaborationJoin.h" -static BOOL CALLBACK AP_Win32Dialog_CollaborationJoin::s_dlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +BOOL CALLBACK AP_Win32Dialog_CollaborationJoin::s_dlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { AP_Win32Dialog_CollaborationJoin * pThis; switch (msg) @@ -95,8 +95,6 @@ UT_return_if_fail(pFrame); UT_return_if_fail(m_hInstance); - XAP_Win32App* pWin32App = static_cast(XAP_App::getApp()); - LPCTSTR lpTemplate = MAKEINTRESOURCE(AP_RID_DIALOG_COLLABORATIONJOIN); int result = DialogBoxParam( m_hInstance, lpTemplate, @@ -135,12 +133,8 @@ // If we can't init common controls, bail out UT_return_val_if_fail(InitCommonControlsEx(&icc), false); - ////// // Get ourselves a custom DialogHelper - if (p_win32Dialog) - { - DELETEP(p_win32Dialog); - } + DELETEP(p_win32Dialog); p_win32Dialog = new XAP_Win32DialogHelper(hWnd); ////// @@ -155,36 +149,35 @@ // Center Window p_win32Dialog->centerDialog(); - // WM_INITDIALOG wants True returned in order to continue processing return true; } BOOL AP_Win32Dialog_CollaborationJoin::_onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { - WORD wNotifyCode = HIWORD(wParam); WORD wId = LOWORD(wParam); - HWND hWndCtrl = (HWND)lParam; - switch (wId) { - case AP_RID_DIALOG_COLLABORATIONJOIN_JOIN_BUTTON: + case AP_RID_DIALOG_COLLABORATIONJOIN_DISCONNECT_BUTTON: + // join and close + // Formerly/secretly the OK button + _setJoin(m_hSelected, false); + EndDialog(hWnd, 0); + return true; + + case AP_RID_DIALOG_COLLABORATIONJOIN_CONNECT_BUTTON: // join and close // Formerly/secretly the OK button _setJoin(m_hSelected, true); - EndDialog(hWnd,0); - - // WM_COMMAND message processed - return 0 - return 0; + EndDialog(hWnd, 0); + return true; case AP_RID_DIALOG_COLLABORATIONJOIN_CLOSE_BUTTON: // Close without necessarily joining // formerly/secretly the Cancel button EndDialog(hWnd,0); - - // WM_COMMAND message processed - return 0 - return 0; + return true; case AP_RID_DIALOG_COLLABORATIONJOIN_ADDBUDDY_BUTTON: // open the Add Buddy dialog @@ -198,16 +191,12 @@ // Refresh documents _refreshAllDocHandlesAsync(); _setModel(); - - // WM_COMMAND message processed - return 0 - return 0; + return true; case AP_RID_DIALOG_COLLABORATIONJOIN_DELETE_BUTTON: - // right now, do nothing // TODO: Implement! - // didn't actually handle this - return 1; + return false; case AP_RID_DIALOG_COLLABORATIONJOIN_REFRESH_BUTTON: // TODO: we really should refresh the buddies here as well, @@ -215,13 +204,10 @@ // avahi backend) _refreshAllDocHandlesAsync(); _setModel(); - - // WM_COMMAND message processed - return 0 - return 0; + return true; default: - // WM_COMMAND message not handled - return 1 to require Windows to process it. - return 1; + return false; } } @@ -232,7 +218,9 @@ //UT_DEBUGMSG(("Notify: Code=0x%x\n", ((LPNMHDR)lParam)->code)); case NM_DBLCLK: - // A double-click will toggle join status + return false; // need to think this through, just toggling the state sounds wrong to me, UI-wise - MARCM + +/* // A double-click will toggle join status // TODO: This is probably awful GUI-wise _updateSelection(); // join stuff! @@ -252,7 +240,7 @@ _refreshAllDocHandlesAsync(); _setModel(); } - return 1; + return 1;*/ case TVN_SELCHANGED: _updateSelection(); @@ -277,10 +265,10 @@ SetWindowLong(m_hDocumentTreeview, GWL_STYLE, styles); // Loop through accounts - for (UT_sint32 i = 0; i < accounts.getItemCount(); i++) + for (UT_uint32 i = 0; i < accounts.getItemCount(); i++) { // Loop through buddies in accounts - for (UT_sint32 j = 0; j < accounts.getNthItem(i)->getBuddies().size(); j++) + for (UT_uint32 j = 0; j < accounts.getNthItem(i)->getBuddies().size(); j++) { const Buddy* pBuddy = accounts.getNthItem(i)->getBuddies()[j]; UT_UTF8String buddyDesc = pBuddy->getDescription(); @@ -292,8 +280,8 @@ tviBuddy.item.stateMask = TVIS_BOLD|TVIS_EXPANDED; tviBuddy.hInsertAfter = TVI_LAST; // only insert at the end tviBuddy.hParent = NULL; // top most level Item - tviBuddy.item.state = NULL; - tviBuddy.item.pszText = sBuddyText.c_str(); + tviBuddy.item.state = 0; + tviBuddy.item.pszText = const_cast(sBuddyText.c_str()); HTREEITEM htiBuddy = (HTREEITEM)SendMessage(m_hDocumentTreeview, TVM_INSERTITEM,0,(LPARAM)&tviBuddy); m_mTreeItemHandles.insert(std::pair(htiBuddy, ShareListItem(pBuddy, NULL))); @@ -311,10 +299,10 @@ tviDocument.hInsertAfter = TVI_LAST; // only insert at the end tviDocument.hParent = htiBuddy; tviDocument.hInsertAfter = TVI_LAST; - tviDocument.item.pszText = sDocText.c_str(); + tviDocument.item.pszText = const_cast(sDocText.c_str()); // if we are connected to this document, bold it. Eventually checkboxes would be cooler, that's a TODO tviDocument.item.state = pManager->isActive(item->m_docHandle->getSessionId()) ? TVIS_BOLD : TVIS_EXPANDED; - HTREEITEM htiDoc = SendMessage(m_hDocumentTreeview, TVM_INSERTITEM,0,(LPARAM)&tviDocument); + HTREEITEM htiDoc = (HTREEITEM)SendMessage(m_hDocumentTreeview, TVM_INSERTITEM, 0, (LPARAM)&tviDocument); m_mTreeItemHandles.insert(std::pair(htiDoc, ShareListItem(pBuddy, item->m_docHandle))); } } @@ -343,10 +331,12 @@ void AP_Win32Dialog_CollaborationJoin::_updateSelection() { + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_if_fail(pManager); + HTREEITEM hSelItem = TreeView_GetSelection(m_hDocumentTreeview); if (hSelItem) { - m_bHasSelection = true; m_hSelected = hSelItem; std::map< HTREEITEM, ShareListItem >::const_iterator cit = m_mTreeItemHandles.find(hSelItem); @@ -354,60 +344,59 @@ if (cit->second.pDocHandle) { UT_DEBUGMSG(("Document selected\n")); - // If the doc handle isn't null then this is a document - m_bShareSelected=true; - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_JOIN_BUTTON, true); + bool bIsConnected = pManager->isActive(cit->second.pDocHandle->getSessionId()); + p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_DISCONNECT_BUTTON, bIsConnected ); + p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_CONNECT_BUTTON, !bIsConnected ); p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_DELETE_BUTTON, false); } else { UT_DEBUGMSG(("Buddy selected\n")); - // This is just a buddy. - m_bShareSelected=false; - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_JOIN_BUTTON, false); + p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_DISCONNECT_BUTTON, false); + p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_CONNECT_BUTTON, false); p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_DELETE_BUTTON, true); } } else { - m_bHasSelection = false; - m_bShareSelected = false; - p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_JOIN_BUTTON, false); + p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_DISCONNECT_BUTTON, false); + p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_CONNECT_BUTTON, false); p_win32Dialog->enableControl(AP_RID_DIALOG_COLLABORATIONJOIN_DELETE_BUTTON, false); } - } -// Return value: true if the join status was updated -// false if the desired status was already the current status -bool AP_Win32Dialog_CollaborationJoin::_setJoin(HTREEITEM hItem, bool joinStatus) +void AP_Win32Dialog_CollaborationJoin::_setJoin(HTREEITEM hItem, bool joinStatus) { AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); - UT_return_val_if_fail(pManager, false); + UT_return_if_fail(pManager); std::map< HTREEITEM, ShareListItem >::const_iterator cit = m_mTreeItemHandles.find(hItem); - UT_return_val_if_fail(cit != m_mTreeItemHandles.end(), false); - - Buddy* pBuddy = cit->second.pBuddy; + UT_return_if_fail(cit != m_mTreeItemHandles.end()); + + const Buddy* pBuddy = cit->second.pBuddy; UT_return_if_fail(pBuddy); DocHandle* pDocHandle = cit->second.pDocHandle; UT_return_if_fail(pDocHandle); - + bool currentlyJoined = pManager->isActive(pDocHandle->getSessionId()); + UT_return_if_fail(joinStatus != currentlyJoined); - if (joinStatus && !currentlyJoined) + if (joinStatus) { - _join(pBuddy, pDocHandle); - return true; + UT_DEBUGMSG(("Got a document we can connect to!\n")); + m_answer = AP_Dialog_CollaborationJoin::a_CONNECT; + m_pBuddy = pBuddy; + m_pDocHandle = pDocHandle; + return; } - if (!joinStatus && currentlyJoined) + if (!joinStatus) { - _disjoin(pBuddy, pDocHandle); - return true; + UT_DEBUGMSG(("Got a document we can disconnect from!\n")); + m_answer = AP_Dialog_CollaborationJoin::a_DISCONNECT; + m_pBuddy = pBuddy; + m_pDocHandle = pDocHandle; + return; } - - // We did not have to change the status - return false; } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationJoin.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationJoin.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationJoin.h 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Dialog_CollaborationJoin.h 2008-07-13 13:05:13.000000000 +0100 @@ -34,8 +34,8 @@ struct ShareListItem { - ShareListItem(Buddy* pBuddy_, DocHandle* pDocHandle_) : pBuddy(pBuddy_), pDocHandle(pDocHandle_) {}; - Buddy* pBuddy; + ShareListItem(const Buddy* pBuddy_, DocHandle* pDocHandle_) : pBuddy(pBuddy_), pDocHandle(pDocHandle_) {}; + const Buddy* pBuddy; DocHandle* pDocHandle; }; @@ -58,16 +58,13 @@ void _refreshWindow(); void _enableBuddyAddition(bool bEnabled); void _updateSelection(); - bool _setJoin(HTREEITEM hItem, bool joinStatus); + void _setJoin(HTREEITEM hItem, bool joinStatus); // Handles HINSTANCE m_hInstance; HWND m_hDocumentTreeview; // Internal states - BOOL m_bHasSelection; - BOOL m_bBuddySelected; - BOOL m_bShareSelected; HTREEITEM m_hSelected; // Model diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Res_CollaborationDialogs.rc /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Res_CollaborationDialogs.rc --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Res_CollaborationDialogs.rc 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Res_CollaborationDialogs.rc 2008-07-13 13:05:14.000000000 +0100 @@ -21,10 +21,13 @@ ////////////////////////////////////////////////////////////////// // Include all the dialogs for AbiCollab since the resource compiler only likes compiling -// one RCSRCS file per directory +// one RCSRCS file per executable #include "ap_Win32Res_DlgCollaborationAccounts.rc2" #include "ap_Win32Res_DlgCollaborationAddAccount.rc2" #include "ap_Win32Res_DlgCollaborationAddBuddy.rc2" #include "ap_Win32Res_DlgCollaborationJoin.rc2" +#ifdef ABICOLLAB_HANDLER_SERVICE +#include "../../../backends/service/win/ap_Win32Res_ServiceDialogs.rc" +#endif diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Res_DlgCollaborationJoin.rc2 /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Res_DlgCollaborationJoin.rc2 --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Res_DlgCollaborationJoin.rc2 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/ap_Win32Res_DlgCollaborationJoin.rc2 2008-07-13 13:05:13.000000000 +0100 @@ -21,12 +21,13 @@ #define AP_RID_DIALOG_COLLABORATIONJOIN 604 -#define AP_RID_DIALOG_COLLABORATIONJOIN_JOIN_BUTTON IDOK +#define AP_RID_DIALOG_COLLABORATIONJOIN_DISCONNECT_BUTTON 1000 +#define AP_RID_DIALOG_COLLABORATIONJOIN_CONNECT_BUTTON 1001 #define AP_RID_DIALOG_COLLABORATIONJOIN_CLOSE_BUTTON IDCANCEL -#define AP_RID_DIALOG_COLLABORATIONJOIN_DOCUMENT_TREE 1000 -#define AP_RID_DIALOG_COLLABORATIONJOIN_ADDBUDDY_BUTTON 1001 -#define AP_RID_DIALOG_COLLABORATIONJOIN_DELETE_BUTTON 1002 -#define AP_RID_DIALOG_COLLABORATIONJOIN_REFRESH_BUTTON 1003 +#define AP_RID_DIALOG_COLLABORATIONJOIN_DOCUMENT_TREE 1002 +#define AP_RID_DIALOG_COLLABORATIONJOIN_ADDBUDDY_BUTTON 1003 +#define AP_RID_DIALOG_COLLABORATIONJOIN_DELETE_BUTTON 1004 +#define AP_RID_DIALOG_COLLABORATIONJOIN_REFRESH_BUTTON 1005 #ifdef RC_INVOKED // NOTE -- these placeholder strings get overridden at runtime @@ -37,7 +38,8 @@ CAPTION "Join Collaboration" FONT 8, "MS Sans Serif" BEGIN - DEFPUSHBUTTON "Join",AP_RID_DIALOG_COLLABORATIONJOIN_JOIN_BUTTON,125,154,50,14, WS_TABSTOP + DEFPUSHBUTTON "Disconnect",AP_RID_DIALOG_COLLABORATIONJOIN_DISCONNECT_BUTTON,67,154,50,14, WS_TABSTOP + DEFPUSHBUTTON "Connect",AP_RID_DIALOG_COLLABORATIONJOIN_CONNECT_BUTTON,125,154,50,14, WS_TABSTOP PUSHBUTTON "Close",AP_RID_DIALOG_COLLABORATIONJOIN_CLOSE_BUTTON,183,154,50,14, WS_TABSTOP CONTROL "", AP_RID_DIALOG_COLLABORATIONJOIN_DOCUMENT_TREE, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT| TVS_DISABLEDRAGDROP | WS_TABSTOP | WS_BORDER | WS_VSCROLL, 7, 16, 168, 124 PUSHBUTTON "Add Buddy", AP_RID_DIALOG_COLLABORATIONJOIN_ADDBUDDY_BUTTON, 181, 18, 55, 14, WS_TABSTOP diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/GNUmakefile.in 2008-04-06 22:37:39.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/GNUmakefile.in 2008-07-13 14:10:00.000000000 +0100 @@ -92,6 +92,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/win/Makefile 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/win/Makefile 2008-07-13 13:05:14.000000000 +0100 @@ -21,6 +21,7 @@ ABI_ROOT:=$(shell pwd)/../../../../../../abi include $(ABI_ROOT)/src/config/abi_defs.mk +include $(shell pwd)/../../../abicollab_config.mk TARGETS= $(OBJS) CPPSRCS= ap_Win32Dialog_CollaborationAccounts.cpp \ @@ -38,13 +39,14 @@ -I$(ABI_ROOT)/../libs/boost -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers # compiler (MinGW, MSVC, etc) specific ifeq ($(OS_NAME),MINGW32) + INCLUDES += $(BACKEND_INCLUDES) else OS_CFLAGS+=-GX endif diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationAccounts.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationAccounts.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationAccounts.cpp 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationAccounts.cpp 2008-07-13 13:05:12.000000000 +0100 @@ -40,8 +40,28 @@ bool AP_Dialog_CollaborationAccounts::_addAccount(AccountHandler* pAccount) { + UT_return_val_if_fail(pAccount, false); + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); - return pManager->addAccount(pAccount); + UT_return_val_if_fail(pManager, false); + + bool success = pManager->addAccount(pAccount); + if (success) + pManager->storeProfile(); + return success; +} + +bool AP_Dialog_CollaborationAccounts::_deleteAccount(AccountHandler* pAccount) +{ + UT_return_val_if_fail(pAccount, false); + + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_val_if_fail(pManager, false); + + bool success = pManager->destroyAccount(pAccount); + if (success) + pManager->storeProfile(); + return success; } void AP_Dialog_CollaborationAccounts::createNewAccount() diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationAccounts.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationAccounts.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationAccounts.h 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationAccounts.h 2008-07-13 13:05:13.000000000 +0100 @@ -47,7 +47,8 @@ protected: bool _addAccount(AccountHandler* pHandler); - + bool _deleteAccount(AccountHandler* pAccount); + AP_Dialog_CollaborationAccounts::tAnswer m_answer; }; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationJoin.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationJoin.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationJoin.cpp 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationJoin.cpp 2008-07-13 13:05:13.000000000 +0100 @@ -34,7 +34,9 @@ #include AP_Dialog_CollaborationJoin::AP_Dialog_CollaborationJoin(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id) - : XAP_Dialog_NonPersistent(pDlgFactory, id, "interface/dialogcollaborationjoin") + : XAP_Dialog_NonPersistent(pDlgFactory, id, "interface/dialogcollaborationjoin"), + m_pBuddy(NULL), + m_pDocHandle(NULL) { AbiCollabSessionManager::getManager()->registerEventListener(this); } @@ -121,27 +123,6 @@ _enableBuddyAddition(bEnableAddition); } -void AP_Dialog_CollaborationJoin::_join(Buddy* pBuddy, DocHandle* pDocHandle) -{ - UT_DEBUGMSG(("AP_Dialog_CollaborationJoin::_join()\n")); - UT_return_if_fail(pBuddy); - UT_return_if_fail(pDocHandle); - AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); - pManager->joinSessionInitiate(pBuddy, pDocHandle); -} - -void AP_Dialog_CollaborationJoin::_disjoin(Buddy* pBuddy, DocHandle* pDocHandle) -{ - UT_DEBUGMSG(("AP_Dialog_CollaborationJoin::_disjoin()\n")); - UT_return_if_fail(pBuddy); - UT_return_if_fail(pDocHandle); - - UT_DEBUGMSG(("Disjoining from session |%s| which was shared by |%s|\n", pDocHandle->getSessionId().utf8_str(), pBuddy->getDescription().utf8_str())); - AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); - UT_return_if_fail(pManager); - pManager->disjoinSession(pDocHandle->getSessionId()); -} - void AP_Dialog_CollaborationJoin::signal(const Event& event, const Buddy* pSource) { UT_DEBUGMSG(("AP_Dialog_CollaborationJoin::signal()\n")); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationJoin.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationJoin.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationJoin.h 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/ap_Dialog_CollaborationJoin.h 2008-07-13 13:05:13.000000000 +0100 @@ -40,11 +40,23 @@ void signal(const Event& event, const Buddy* pSource); + typedef enum { a_CLOSE, a_CONNECT, a_DISCONNECT } tAnswer; + + AP_Dialog_CollaborationJoin::tAnswer getAnswer(void) const + { return m_answer; } + + const Buddy* getBuddy() + { return m_pBuddy; }; + + DocHandle* getDocHandle() + { return m_pDocHandle; }; + protected: - void _eventAddBuddy(); - void _join(Buddy* pBuddy, DocHandle* pDocHandle); - void _disjoin(Buddy* pBuddy, DocHandle* pDocHandle); + AP_Dialog_CollaborationJoin::tAnswer m_answer; + const Buddy* m_pBuddy; + DocHandle* m_pDocHandle; + void _eventAddBuddy(); void _addBuddy(AccountHandler* pHandler, Buddy* pBuddy); void _refreshAllDocHandlesAsync(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/GNUmakefile.in 2008-04-06 22:37:39.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/GNUmakefile.in 2008-07-13 14:10:00.000000000 +0100 @@ -91,6 +91,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/dialogs/xp/Makefile 2008-04-06 22:36:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/dialogs/xp/Makefile 2008-07-13 13:05:13.000000000 +0100 @@ -20,6 +20,7 @@ ABI_ROOT:=$(shell pwd)/../../../../../../abi include $(ABI_ROOT)/src/config/abi_defs.mk +include $(shell pwd)/../../../abicollab_config.mk TARGETS= $(OBJS) CPPSRCS= ap_Dialog_CollaborationAccounts.cpp \ @@ -34,13 +35,14 @@ -I$(ABI_ROOT)/../libs/boost -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers # compiler (MinGW, MSVC, etc) specific ifeq ($(OS_NAME),MINGW32) + INCLUDES += $(BACKEND_INCLUDES) else OS_CFLAGS+=-GX endif diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/GNUmakefile.in 2008-04-06 22:37:38.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/GNUmakefile.in 2008-07-13 14:09:59.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/Makefile 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/Makefile 2008-07-13 13:05:16.000000000 +0100 @@ -26,7 +26,7 @@ TARGETS= $(OBJS) -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/GNUmakefile.in 2008-04-06 22:37:39.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/GNUmakefile.in 2008-07-13 14:10:00.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/Makefile 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/Makefile 2008-07-13 13:05:15.000000000 +0100 @@ -26,7 +26,7 @@ -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/AbiCollab_Packet.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/AbiCollab_Packet.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/AbiCollab_Packet.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/AbiCollab_Packet.cpp 2008-07-13 13:05:15.000000000 +0100 @@ -69,6 +69,8 @@ PT_IMAGE_DATAID, PT_IMAGE_TITLE, PT_IMAGE_DESCRIPTION, + PT_DATA_PREVIEW, + PT_HYPERLINK_TARGET_NAME }; UT_sint16 getPacket_PTName_Index( const gchar* name ) @@ -225,40 +227,33 @@ static const std::string& getPXTypeStr( PX_ChangeRecord::PXType t ) { - bool safeGuard; - UT_ASSERT( safeGuard = (t>=PX_ChangeRecord::PXT_GlobMarker && t<=PX_ChangeRecord::PXT_ChangeDocProp) ); - if (safeGuard) { - static std::string pxTypeStrs[] = { - "PXT_GlobMarker", - "PXT_InsertSpan", - "PXT_DeleteSpan", - "PXT_ChangeSpan", - "PXT_InsertStrux", - "PXT_DeleteStrux", - "PXT_ChangeStrux", - "PXT_InsertObject", - "PXT_DeleteObject", - "PXT_ChangeObject", - "PXT_InsertFmtMark", - "PXT_DeleteFmtMark", - "PXT_ChangeFmtMark", - "PXT_ChangePoint", - "PXT_ListUpdate", - "PXT_StopList", - "PXT_UpdateField", - "PXT_RemoveList", - "PXT_UpdateLayout", - "PXT_AddStyle", - "PXT_RemoveStyle", - "PXT_CreateDataItem", - "PXT_ChangeDocProp", - }; - return pxTypeStrs[ int(t)+1 ]; - } else { - static std::string invalidValue; - invalidValue = str(boost::format( "" ) % int(t) ); - return invalidValue; - } + UT_return_val_if_fail(t >= PX_ChangeRecord::PXT_GlobMarker && t <= PX_ChangeRecord::PXT_ChangeDocProp, str(boost::format( "" ) % int(t) )); + static std::string pxTypeStrs[] = { + "PXT_GlobMarker", + "PXT_InsertSpan", + "PXT_DeleteSpan", + "PXT_ChangeSpan", + "PXT_InsertStrux", + "PXT_DeleteStrux", + "PXT_ChangeStrux", + "PXT_InsertObject", + "PXT_DeleteObject", + "PXT_ChangeObject", + "PXT_InsertFmtMark", + "PXT_DeleteFmtMark", + "PXT_ChangeFmtMark", + "PXT_ChangePoint", + "PXT_ListUpdate", + "PXT_StopList", + "PXT_UpdateField", + "PXT_RemoveList", + "PXT_UpdateLayout", + "PXT_AddStyle", + "PXT_RemoveStyle", + "PXT_CreateDataItem", + "PXT_ChangeDocProp", + }; + return pxTypeStrs[ int(t)+1 ]; } std::string ChangeRecordSessionPacket::toStr() const @@ -337,6 +332,7 @@ i += 2; } m_szProps[i] = NULL; + UT_DEBUGMSG(("Props of packet %s \n",m_szProps)); } void Props_ChangeRecordSessionPacket::_fillAtts() @@ -409,37 +405,30 @@ static const std::string& getPTStruxTypeStr( PTStruxType p ) { - bool safeGuard; - UT_ASSERT( safeGuard = (p>=PTX_Section && p<=PTX_StruxDummy) ); - if (safeGuard) { - static std::string PacketSessionTypeStrs[] = { - "PTX_Section", - "PTX_Block", - "PTX_SectionHdrFtr", - "PTX_SectionEndnote", - "PTX_SectionTable", - "PTX_SectionCell", - "PTX_SectionFootnote", - "PTX_SectionMarginnote", - "PTX_SectionAnnotation", - "PTX_SectionFrame", - "PTX_SectionTOC", - "PTX_EndCell", - "PTX_EndTable", - "PTX_EndFootnote", - "PTX_EndMarginnote", - "PTX_EndEndnote", - "PTX_EndAnnotation", - "PTX_EndFrame", - "PTX_EndTOC", - "PTX_StruxDummy", - }; - return PacketSessionTypeStrs[ int(p) ]; - } else { - static std::string invalidValue; - invalidValue = str(boost::format( "" ) % int(p) ); - return invalidValue; - } + UT_return_val_if_fail(p >= PTX_Section && p <= PTX_StruxDummy, str(boost::format( "" ) % int(p) )); + static std::string PacketSessionTypeStrs[] = { + "PTX_Section", + "PTX_Block", + "PTX_SectionHdrFtr", + "PTX_SectionEndnote", + "PTX_SectionTable", + "PTX_SectionCell", + "PTX_SectionFootnote", + "PTX_SectionMarginnote", + "PTX_SectionAnnotation", + "PTX_SectionFrame", + "PTX_SectionTOC", + "PTX_EndCell", + "PTX_EndTable", + "PTX_EndFootnote", + "PTX_EndMarginnote", + "PTX_EndEndnote", + "PTX_EndAnnotation", + "PTX_EndFrame", + "PTX_EndTOC", + "PTX_StruxDummy", + }; + return PacketSessionTypeStrs[ int(p) ]; } void InsertSpan_ChangeRecordSessionPacket::serialize( Archive& ar ) @@ -489,23 +478,16 @@ static const std::string& getPTObjectTypeStr( PTObjectType p ) { - bool safeGuard; - UT_ASSERT( safeGuard = (p>=PTO_Image && p<=PTO_Embed) ); - if (safeGuard) { - static std::string PTObjectTypeStrs[] = { - "PTO_Image", - "PTO_Field", - "PTO_Bookmark", - "PTO_Hyperlink", - "PTO_Math", - "PTO_Embed" - }; - return PTObjectTypeStrs[ int(p) ]; - } else { - static std::string invalidValue; - invalidValue = str(boost::format( "" ) % int(p) ); - return invalidValue; - } + UT_return_val_if_fail(p >= PTO_Image && p <= PTO_Embed, str(boost::format( "" ) % int(p) )); + static std::string PTObjectTypeStrs[] = { + "PTO_Image", + "PTO_Field", + "PTO_Bookmark", + "PTO_Hyperlink", + "PTO_Math", + "PTO_Embed" + }; + return PTObjectTypeStrs[ int(p) ]; } std::string Object_ChangeRecordSessionPacket::toStr() const diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/AbiCollab_Packet.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/AbiCollab_Packet.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/AbiCollab_Packet.h 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/AbiCollab_Packet.h 2008-07-13 13:05:15.000000000 +0100 @@ -155,7 +155,7 @@ }; \ static PacketRegister##Class _PacketRegister##Class; -class ABI_EXPORT Packet +class Packet { public: DECLARE_ABSTRACT_PACKET(Packet); @@ -199,7 +199,7 @@ * SessionPackets * *************************************************************/ -class ABI_EXPORT SessionPacket : public Packet +class SessionPacket : public Packet { public: DECLARE_SERIALIZABLE_PACKET @@ -230,7 +230,7 @@ UT_UTF8String m_sDocUUID; }; -class ABI_EXPORT AbstractChangeRecordSessionPacket : public SessionPacket +class AbstractChangeRecordSessionPacket : public SessionPacket { public: AbstractChangeRecordSessionPacket() @@ -250,7 +250,7 @@ virtual UT_sint32 getRemoteRev(void) const = 0; }; -class ABI_EXPORT ChangeRecordSessionPacket : public AbstractChangeRecordSessionPacket +class ChangeRecordSessionPacket : public AbstractChangeRecordSessionPacket { public: DECLARE_PACKET(ChangeRecordSessionPacket); @@ -296,7 +296,7 @@ UT_sint32 m_iRemoteRev; }; -class ABI_EXPORT Props_ChangeRecordSessionPacket : public ChangeRecordSessionPacket { +class Props_ChangeRecordSessionPacket : public ChangeRecordSessionPacket { public: DECLARE_PACKET(Props_ChangeRecordSessionPacket); Props_ChangeRecordSessionPacket() : m_szAtts(NULL), m_szProps(NULL) {} @@ -341,7 +341,7 @@ void _fillAtts(); // uses m_sAtts to make m_szAtts }; -class ABI_EXPORT InsertSpan_ChangeRecordSessionPacket : public Props_ChangeRecordSessionPacket { +class InsertSpan_ChangeRecordSessionPacket : public Props_ChangeRecordSessionPacket { public: DECLARE_PACKET(InsertSpan_ChangeRecordSessionPacket); InsertSpan_ChangeRecordSessionPacket() : m_sText("") {} @@ -362,7 +362,7 @@ UT_UTF8String m_sText; }; -class ABI_EXPORT ChangeStrux_ChangeRecordSessionPacket : public Props_ChangeRecordSessionPacket { +class ChangeStrux_ChangeRecordSessionPacket : public Props_ChangeRecordSessionPacket { public: DECLARE_PACKET(ChangeStrux_ChangeRecordSessionPacket); ChangeStrux_ChangeRecordSessionPacket() : m_eStruxType(PTStruxType(0)) {} @@ -382,7 +382,7 @@ PTStruxType m_eStruxType; }; -class ABI_EXPORT DeleteStrux_ChangeRecordSessionPacket : public ChangeRecordSessionPacket { +class DeleteStrux_ChangeRecordSessionPacket : public ChangeRecordSessionPacket { public: DECLARE_PACKET(DeleteStrux_ChangeRecordSessionPacket); DeleteStrux_ChangeRecordSessionPacket() {} @@ -402,7 +402,7 @@ PTStruxType m_eStruxType; }; -class ABI_EXPORT Object_ChangeRecordSessionPacket : public Props_ChangeRecordSessionPacket { +class Object_ChangeRecordSessionPacket : public Props_ChangeRecordSessionPacket { public: DECLARE_PACKET(Object_ChangeRecordSessionPacket); Object_ChangeRecordSessionPacket() {} @@ -422,7 +422,7 @@ PTObjectType m_eObjectType; }; -class ABI_EXPORT Data_ChangeRecordSessionPacket : public Props_ChangeRecordSessionPacket { +class Data_ChangeRecordSessionPacket : public Props_ChangeRecordSessionPacket { public: DECLARE_PACKET(Data_ChangeRecordSessionPacket); Data_ChangeRecordSessionPacket() @@ -447,7 +447,7 @@ std::string m_sToken; }; -class ABI_EXPORT Glob_ChangeRecordSessionPacket : public ChangeRecordSessionPacket +class Glob_ChangeRecordSessionPacket : public ChangeRecordSessionPacket { public: DECLARE_PACKET(Glob_ChangeRecordSessionPacket); @@ -468,7 +468,7 @@ UT_Byte m_iGLOBType; }; -class ABI_EXPORT GlobSessionPacket : public AbstractChangeRecordSessionPacket +class GlobSessionPacket : public AbstractChangeRecordSessionPacket { public: DECLARE_PACKET(GlobSessionPacket); @@ -495,7 +495,7 @@ std::vector m_pPackets; }; -class ABI_EXPORT SignalSessionPacket : public SessionPacket +class SignalSessionPacket : public SessionPacket { public: DECLARE_PACKET(SignalSessionPacket); @@ -511,7 +511,7 @@ UT_uint32 m_iSignal; }; -class ABI_EXPORT RevertSessionPacket : public SessionPacket +class RevertSessionPacket : public SessionPacket { public: DECLARE_PACKET(RevertSessionPacket); @@ -527,7 +527,7 @@ UT_sint32 m_iRev; }; -class ABI_EXPORT RevertAckSessionPacket : public SessionPacket +class RevertAckSessionPacket : public SessionPacket { public: DECLARE_PACKET(RevertAckSessionPacket); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/EventPacket.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/EventPacket.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/EventPacket.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/EventPacket.h 2008-07-13 13:05:15.000000000 +0100 @@ -25,7 +25,7 @@ #include "ut_string_class.h" #include "AbiCollab_Packet.h" -class ABI_EXPORT EventPacket : public Packet +class EventPacket : public Packet { public: DECLARE_ABSTRACT_PACKET(EventPacket); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/GNUmakefile.in 2008-04-06 22:37:39.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/GNUmakefile.in 2008-07-13 14:10:01.000000000 +0100 @@ -87,6 +87,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/Makefile 2008-04-06 22:36:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/Makefile 2008-07-13 13:05:15.000000000 +0100 @@ -32,7 +32,7 @@ -I$(ABI_ROOT)/../libs/boost -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/Serialization.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/Serialization.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/packet/xp/Serialization.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/packet/xp/Serialization.h 2008-07-13 13:05:15.000000000 +0100 @@ -65,7 +65,7 @@ * ar << COMPACT_INT(m_iRev); */ #define COMPACT_INT(v) (*(CompactInt*)&v) -struct ABI_EXPORT CompactInt { +struct CompactInt { public: friend Archive& operator<<( Archive& ar, CompactInt& c ); protected: @@ -73,7 +73,7 @@ }; /** Base archive */ -class ABI_EXPORT Archive +class Archive { public: virtual ~Archive() {} @@ -194,7 +194,7 @@ }; /** String based archive */ -class ABI_EXPORT StrArchive : public Archive +class StrArchive : public Archive { public: unsigned int Size() const { return m_sSource.size(); } @@ -211,7 +211,7 @@ }; /** Input (loading) archive */ -class ABI_EXPORT IStrArchive : public StrArchive +class IStrArchive : public StrArchive { public: IStrArchive( const std::string& sSource ) @@ -242,7 +242,7 @@ }; /** Output (saving) archive */ -class ABI_EXPORT OStrArchive : public StrArchive +class OStrArchive : public StrArchive { public: OStrArchive() diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/GNUmakefile.in 2008-04-06 22:37:40.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/GNUmakefile.in 2008-07-13 14:10:01.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/Makefile 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/Makefile 2008-07-13 13:05:15.000000000 +0100 @@ -25,7 +25,7 @@ TARGETS= $(OBJS) -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Command.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Command.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Command.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Command.h 2008-07-13 13:05:15.000000000 +0100 @@ -26,7 +26,7 @@ class FakeAccountHandler; #endif -class ABI_EXPORT AbiCollab_Command +class AbiCollab_Command { public: AbiCollab_Command(const UT_UTF8String& argv); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab.cpp 2008-07-13 13:05:14.000000000 +0100 @@ -72,9 +72,10 @@ } // Use this constructor to host a collaboration session -AbiCollab::AbiCollab(PD_Document* pDoc, const UT_UTF8String& sSessionId) +AbiCollab::AbiCollab(PD_Document* pDoc, const UT_UTF8String& sSessionId, XAP_Frame* pFrame) : EV_MouseListener(), m_pDoc(pDoc), + m_pFrame(pFrame), m_Import(this, pDoc), m_Export(this, pDoc), m_iDocListenerId(0), @@ -91,7 +92,7 @@ // TODO: this can be made a lil' more efficient, as setDocument // will create import and export listeners, which is kinda useless // when there is no single collaborator yet - _setDocument(pDoc); + _setDocument(pDoc, pFrame); #ifdef ABICOLLAB_RECORD_ALWAYS startRecording( new DiskSessionRecorder( this ) ); @@ -104,9 +105,10 @@ const UT_UTF8String& docUUID, UT_sint32 iRev, Buddy* pController, - bool bReuseCurrentFrame) + XAP_Frame* pFrame) : EV_MouseListener(), m_pDoc(pDoc), + m_pFrame(pFrame), m_Import(this, pDoc), m_Export(this, pDoc), m_iDocListenerId(0), @@ -122,7 +124,7 @@ // TODO: this can be made a lil' more efficient, as setDocument // will create import and export listeners, which is kinda useless // when there is no single collaborator yet - _setDocument(pDoc, bReuseCurrentFrame); + _setDocument(pDoc, pFrame); m_Import.setInitialRemoteRev(pController->getName(), iRev); m_Export.addFakeImportAdjust(docUUID, iRev); @@ -163,7 +165,7 @@ DELETEP(m_pRecorder); } -void AbiCollab::removeCollaborator(Buddy* pCollaborator) +void AbiCollab::removeCollaborator(const Buddy* pCollaborator) { UT_return_if_fail(pCollaborator); @@ -231,10 +233,11 @@ } } -void AbiCollab::_setDocument(PD_Document* pDoc, bool bReuseCurrentFrame) +void AbiCollab::_setDocument(PD_Document* pDoc, XAP_Frame* pFrame) { UT_DEBUGMSG(("AbiCollab::setDocument()\n")); UT_return_if_fail(pDoc); + UT_return_if_fail(pFrame); AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); UT_return_if_fail(pManager); @@ -244,39 +247,14 @@ // update the frame m_pDoc = pDoc; - - // if the document doesn't belong to a frame already, then create a - // new frame for this session (except when the document in the current - // frame is not dirty, doesn't have a filename yet (which means it - // is a brand new empty document), and isn't being shared at the moment) - XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); - if (pFrame) - { - PD_Document * pFrameDoc = static_cast(pFrame->getCurrentDoc()); - if (pFrameDoc != pDoc) - { - if (bReuseCurrentFrame || - (!pFrameDoc || !pFrameDoc->getFilename() && !pFrameDoc->isDirty() && !pManager->isInSession(pFrameDoc))) - { - // we can replace the document in this frame safely, as it is - // brand new, and doesn't have any contents yet - } - else - { - // the current frame has already a document loaded, let's create - // a new frame - pFrame = XAP_App::getApp()->newFrame(); - } - pFrame->loadDocument(m_pDoc); // this will also delete the old document (or at least, it should) - // TODO: the frame shouldn't be raised - } - // register ourselves as a mouse listener - // FIXME: we should do this for all frames that display this document! - EV_Mouse* pMouse = pFrame->getMouse(); - if (pMouse) - m_iMouseLID = pMouse->registerListener(this); - } + // register ourselves as a mouse listener + // FIXME: we should do this for all frames that display this document! + EV_Mouse* pMouse = pFrame->getMouse(); + if (pMouse) + m_iMouseLID = pMouse->registerListener(this); + else + UT_DEBUGMSG(("No current frame!\n")); // add the new export listeners UT_uint32 lid = 0; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Export.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Export.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Export.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Export.cpp 2008-07-13 13:05:14.000000000 +0100 @@ -527,7 +527,7 @@ */ bool ABI_Collab_Export::signal(UT_uint32 iSignal) { - UT_DEBUGMSG(("FIXME FIXME FIXME, DON'T SEND SIGNALS DIRECTLY FROM ABI_Collab_Export::signal()!\n")); + UT_DEBUGMSG(("ABI_Collab_Export::signal()!\n")); SignalSessionPacket* ssp = new SignalSessionPacket(m_pAbiCollab->getSessionId(), m_pDoc->getOrigDocUUIDString(), iSignal); if(m_pGlobPacket) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Export.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Export.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Export.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Export.h 2008-07-13 13:05:15.000000000 +0100 @@ -38,7 +38,7 @@ class ChangeAdjust; class AbiCollab; -class ABI_EXPORT ABI_Collab_Export : public PL_DocChangeListener +class ABI_Collab_Export : public PL_DocChangeListener { friend class AbiCollab; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab.h 2008-07-13 13:05:15.000000000 +0100 @@ -46,7 +46,7 @@ class Buddy; class AccountHandler; -class ABI_EXPORT ChangeAdjust +class ChangeAdjust { friend class AbiCollab_ImportRuleSet; @@ -74,7 +74,7 @@ }; class AbiCollab; -class ABI_EXPORT SessionRecorderInterface +class SessionRecorderInterface { public: SessionRecorderInterface( AbiCollab* Session ) : m_pAbiCollab(Session) {} @@ -86,26 +86,28 @@ AbiCollab* m_pAbiCollab; }; -class ABI_EXPORT AbiCollab : public EV_MouseListener +class AbiCollab : public EV_MouseListener { friend class ABI_Collab_Export; public: - AbiCollab(PD_Document* pDoc, const UT_UTF8String& sSessionId); + AbiCollab(PD_Document* pDoc, const UT_UTF8String& sSessionId, XAP_Frame* pFrame); AbiCollab(const UT_UTF8String& sSessionId, PD_Document* pDoc, const UT_UTF8String& docUUID, UT_sint32 iRev, Buddy* pControler, - bool bReuseCurrentFrame = false); + XAP_Frame* pFrame); virtual ~AbiCollab(); // collaborator management void addCollaborator(Buddy* pCollaborator); - void removeCollaborator(Buddy* pCollaborator); + void removeCollaborator(const Buddy* pCollaborator); void removeCollaboratorsForAccount(AccountHandler* pHandler); const std::vector& getCollaborators() const { return m_vecCollaborators; } + bool isController(const Buddy* pCollaborator) const + { return m_pController == pCollaborator; } // import/export management ABI_Collab_Import* getImport(void) @@ -126,8 +128,10 @@ // document management PD_Document* getDocument(void) const { return m_pDoc; } + XAP_Frame* getFrame(void) const + { return m_pFrame; } - const UT_UTF8String& getSessionId() const + const UT_UTF8String getSessionId() const { return m_sId; } bool isLocallyControlled() const { return m_pController == NULL; } @@ -149,14 +153,14 @@ void _removeCollaborator(UT_sint32 index); // document management - void _setDocument(PD_Document* pDoc, bool bReuseCurrentFrame = false); + void _setDocument(PD_Document* pDoc, XAP_Frame* pFrame); void _setDocListenerId(UT_uint32 iDocListenerId) { m_iDocListenerId = iDocListenerId; } - XAP_Frame* _constructFrame(); void _fillRemoteRev( Packet* pPacket, const Buddy& ); PD_Document * m_pDoc; + XAP_Frame* m_pFrame; ABI_Collab_Import m_Import; ABI_Collab_Export m_Export; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Import.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Import.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Import.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Import.h 2008-07-13 13:05:14.000000000 +0100 @@ -43,7 +43,7 @@ class ABI_xmpp; class ChangeAdjust; -class ABI_EXPORT ABI_Collab_Import +class ABI_Collab_Import { friend class FakeAccountHandler; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_ImportRuleSet.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_ImportRuleSet.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_ImportRuleSet.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_ImportRuleSet.h 2008-07-13 13:05:14.000000000 +0100 @@ -26,7 +26,7 @@ class ChangeAdjust; class AbstractChangeRecordSessionPacket; -class ABI_EXPORT AbiCollab_ImportRuleSet +class AbiCollab_ImportRuleSet { public: static bool isOverlapAllowed(const ChangeAdjust& ca, const AbstractChangeRecordSessionPacket& acrsp, UT_sint32 iRemotePosAdjust); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Plugin.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Plugin.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Plugin.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Plugin.cpp 2008-07-13 13:05:15.000000000 +0100 @@ -55,7 +55,9 @@ // forward declarations static void s_abicollab_add_menus(); static void s_abicollab_remove_menus(); +#if defined(ABICOLLAB_RECORD_ALWAYS) && defined(DEBUG) static void s_cleanup_old_sessions(); +#endif // ----------------------------------------------------------------------- // @@ -531,13 +533,16 @@ else { UT_UTF8String sSessionId(""); - pManager->startSession(pDoc, sSessionId); + pManager->startSession(pDoc, sSessionId, NULL); } return true; } bool s_abicollab_join(AV_View* v, EV_EditMethodCallData *d) { + AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager(); + UT_return_val_if_fail(pManager, false); + // Get the current view that the user is in. XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); // Get an Accounts dialog instance @@ -548,7 +553,33 @@ ); // Run the dialog pDialog->runModal(pFrame); + // Handle the dialog outcome + AP_Dialog_CollaborationJoin::tAnswer answer = pDialog->getAnswer(); + Buddy* pBuddy = const_cast(pDialog->getBuddy()); // FIXME: bad const cast (it should probably stay const) + DocHandle* pDocHandle = pDialog->getDocHandle(); pFactory->releaseDialog(pDialog); + + switch (answer) + { + case AP_Dialog_CollaborationJoin::a_CONNECT: + UT_return_val_if_fail(pBuddy && pDocHandle, false); + pManager->joinSessionInitiate(pBuddy, pDocHandle); + break; + case AP_Dialog_CollaborationJoin::a_DISCONNECT: + { + UT_return_val_if_fail(pBuddy && pDocHandle, false); + AbiCollab* pSession = pManager->getSessionFromSessionId(pDocHandle->getSessionId()); + UT_return_val_if_fail(pSession, false); + if (pSession->isLocallyControlled()) + pManager->closeSession(pSession, true); + else + pManager->disjoinSession(pDocHandle->getSessionId()); + } + break; + case AP_Dialog_CollaborationJoin::a_CLOSE: + break; + } + return true; } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Regression.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Regression.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Regression.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Regression.cpp 2008-07-13 13:05:14.000000000 +0100 @@ -32,6 +32,7 @@ for (std::vector::const_iterator cit = files.begin(); cit != files.end(); cit++) { } + return true; } #ifndef WIN32 diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Regression.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Regression.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Regression.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollab_Regression.h 2008-07-13 13:05:15.000000000 +0100 @@ -25,7 +25,7 @@ #include "ut_types.h" -class ABI_EXPORT AbiCollab_Regression +class AbiCollab_Regression { public: bool execute(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollabSessionManager.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollabSessionManager.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollabSessionManager.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollabSessionManager.cpp 2008-07-13 13:05:14.000000000 +0100 @@ -40,8 +40,6 @@ #ifdef WIN32 #include -// hacky but it works. it's what we get for not having autotools. -#define ABICOLLAB_HANDLER_TCP 1 #else #include #include "ut_files.h" @@ -75,6 +73,13 @@ #include #endif +#ifdef ABICOLLAB_HANDLER_SERVICE +// The TLS tunnel is generic code, but we don't want to include it +// unconditionally as it drags in gnutls. Therefor we only include it if at +// least one backend is enabled that needs TLS support +#include +#endif + // event includes #include #include @@ -147,10 +152,12 @@ return result; } -UT_Error AbiCollabSessionManager::deserializeDocument(PD_Document** pDoc, std::string& document, bool isEncodedBase64) +UT_Error AbiCollabSessionManager::deserializeDocument(PD_Document** pDoc, const std::string& document, bool isEncodedBase64) { + UT_return_val_if_fail(pDoc, UT_ERROR); + UT_Error res = UT_ERROR; - + // really bad abuse of std::string's below, but more efficient than copying // the whole buffer (which could be massive) into a temporary buffer GsfInput *source; @@ -172,13 +179,17 @@ GsfInput *gzabwBuf = gsf_input_gzip_new (source, NULL); // todo: don't pass null here, but check for errors if (gzabwBuf) { - // TODO: if there are unsaved changes to the current document, - // then open this document in a new frame! - (*pDoc) = new PD_Document(XAP_App::getApp()); - (*pDoc)->createRawDocument(); + bool create = (*pDoc == NULL); + if (create) + { + UT_DEBUGMSG(("Creating a new document in AbiCollabSessionManager::deserializeDocument()\n")); + (*pDoc) = new PD_Document(XAP_App::getApp()); + (*pDoc)->createRawDocument(); + } IE_Imp* imp = (IE_Imp*)new IE_Imp_AbiWord_1(*pDoc); imp->importFile(gzabwBuf); // todo: check for errors - (*pDoc)->finishRawCreation(); + if (create) + (*pDoc)->finishRawCreation(); DELETEP(imp); g_object_unref(G_OBJECT(gzabwBuf)); res = UT_OK; @@ -240,7 +251,8 @@ addAccount(pSugarHandler); #endif #ifdef ABICOLLAB_HANDLER_SERVICE - m_regAccountHandlers.push_back(ServiceAccountHandlerConstructor); + if (tls_tunnel::tls_tunnel_init()) + m_regAccountHandlers.push_back(ServiceAccountHandlerConstructor); #endif return true; } @@ -248,7 +260,10 @@ bool AbiCollabSessionManager::unregisterAccountHandlers(void) { // no need to "free/delete" items, as they are just function pointers (ie. basic types) - m_regAccountHandlers.clear(); + m_regAccountHandlers.clear(); +#ifdef ABICOLLAB_HANDLER_SERVICE + tls_tunnel::tls_tunnel_deinit(); +#endif return true; } @@ -370,7 +385,7 @@ pHandler->connect(); break; } - DELETEP(pHandler); + _deleteAccount(pHandler); } } } @@ -481,20 +496,20 @@ bool AbiCollabSessionManager::destroySession(PD_Document * pDoc) { - AbiCollab * pCollab = NULL; + UT_DEBUGMSG(("AbiCollabSessionManager::destroySession(PD_Document * pDoc)\n")); + UT_uint32 i = 0; for (i = 0; i < m_vecSessions.getItemCount(); i++) { - pCollab = m_vecSessions.getNthItem(i); - if (pCollab) + AbiCollab* pSession = m_vecSessions.getNthItem(i); + UT_continue_if_fail(pSession); + + PD_Document* pSessionDoc = pSession->getDocument(); + if (pSessionDoc == pDoc) { - PD_Document* pSessionDoc = pCollab->getDocument(); - if (pSessionDoc == pDoc) - { - DELETEP(pCollab); - m_vecSessions.deleteNthItem(i); - return true; - } + m_vecSessions.deleteNthItem(i); + _deleteSession(pSession); + return true; } } return false; @@ -502,16 +517,18 @@ bool AbiCollabSessionManager::destroySession(AbiCollab* pSession) { - UT_DEBUGMSG(("AbiCollabSessionManager::destroySession()\n")); + UT_DEBUGMSG(("AbiCollabSessionManager::destroySession(AbiCollab* pSession)\n")); UT_uint32 i = 0; for (i = 0; i < m_vecSessions.getItemCount(); i++) { AbiCollab* pActiveSession = m_vecSessions.getNthItem(i); + UT_continue_if_fail(pActiveSession); + if (pActiveSession == pSession) { - DELETEP(pSession); m_vecSessions.deleteNthItem(i); + _deleteSession(pSession); return true; } } @@ -538,12 +555,8 @@ for(UT_uint32 i = 0; i < m_vecSessions.getItemCount(); i++) { AbiCollab* pSession = m_vecSessions.getNthItem(i); - if (pSession) - { - disconnectSession(pSession); - DELETEP(pSession); - } - m_vecSessions.deleteNthItem(i); + UT_continue_if_fail(pSession); + disconnectSession(pSession); } } @@ -605,7 +618,7 @@ return NULL; } -AbiCollab* AbiCollabSessionManager::startSession(PD_Document* pDoc, UT_UTF8String& sSessionId) +AbiCollab* AbiCollabSessionManager::startSession(PD_Document* pDoc, UT_UTF8String& sSessionId, XAP_Frame* pFrame) { UT_DEBUGMSG(("Starting collaboration session for document with id %s\n", pDoc->getDocUUIDString())); @@ -617,7 +630,9 @@ } UT_DEBUGMSG(("Creating a new collaboration session with UUID: %s\n", sSessionId.utf8_str())); - AbiCollab* pAbiCollab = new AbiCollab(pDoc, sSessionId); + + UT_return_val_if_fail(_setupFrame(&pFrame, pDoc), NULL); + AbiCollab* pAbiCollab = new AbiCollab(pDoc, sSessionId, pFrame); m_vecSessions.push_back(pAbiCollab); // notify all people we are sharing a new document @@ -685,19 +700,24 @@ // TODO: do some accounting here, so we know we send an auth request in ::joinSession() } -void AbiCollabSessionManager::joinSession(const UT_UTF8String& sSessionId, PD_Document* pDoc, const UT_UTF8String& docUUID, UT_sint32 iRev, Buddy* pCollaborator) +void AbiCollabSessionManager::joinSession(const UT_UTF8String& sSessionId, PD_Document* pDoc, + const UT_UTF8String& docUUID, UT_sint32 iRev, Buddy* pCollaborator, + XAP_Frame *pFrame) { UT_DEBUGMSG(("AbiCollabSessionManager::joinSession()\n")); UT_return_if_fail(pCollaborator); UT_return_if_fail(pDoc); - AbiCollab* pSession = #ifdef ABICOLLAB_HANDLER_SUGAR - new AbiCollab(sSessionId, pDoc, docUUID, iRev, pCollaborator, true); + // HACK, remove this some day: the sugar backend should just pass us a frame to use + pFrame = XAP_App::getApp()->getLastFocussedFrame(); + pFrame->loadDocument(pDoc); #else - new AbiCollab(sSessionId, pDoc, docUUID, iRev, pCollaborator); -#endif + UT_return_if_fail(_setupFrame(&pFrame, pDoc)); +#endif + + AbiCollab* pSession = new AbiCollab(sSessionId, pDoc, docUUID, iRev, pCollaborator, pFrame); m_vecSessions.push_back(pSession); // signal everyone that we have joined this session @@ -809,6 +829,49 @@ return false; } +void AbiCollabSessionManager::removeBuddy(const Buddy* pBuddy, bool graceful) +{ + UT_return_if_fail(pBuddy); + + UT_DEBUGMSG(("Dropping buddy '%s' from all sessions\n", pBuddy->getName().utf8_str())); + // TODO: should we send out events for every buddy we drop, or session + // we delete? + + for (UT_sint32 i = m_vecSessions.getItemCount() - 1; i >= 0; i--) + { + AbiCollab* pSession = m_vecSessions.getNthItem(i); + UT_continue_if_fail(pSession); + + if (pSession->isLocallyControlled()) + { + pSession->removeCollaborator(pBuddy); + } + else + { + // we don't control this session, meaning we can drop it completely + // if this buddy controlled it + // TODO: when we allow more than 1 buddy in a non-locally controlled, + // then remove it from that list here + if (pSession->isController(pBuddy)) + { + UT_DEBUGMSG(("This buddy controlled a session, destroying the session...\n")); + UT_UTF8String docName = pSession->getDocument()->getFilename(); + if (docName == "") + docName = "Untitled"; // TODO: fetch the title from the frame somehow (which frame?) - MARCM + destroySession(pSession); + if (!graceful) + { + XAP_Frame *pFrame = XAP_App::getApp()->getLastFocussedFrame(); + UT_continue_if_fail(pFrame); + // TODO: make this localizable + UT_UTF8String msg; + UT_UTF8String_sprintf(msg, "You've been disconnected from buddy %s. The collaboration session for document %s has been stopped.", pBuddy->getDescription().utf8_str(), docName.utf8_str()); + pFrame->showMessageBox(msg.utf8_str(), XAP_Dialog_MessageBox::b_O, XAP_Dialog_MessageBox::a_OK); + } + } + } + } +} bool AbiCollabSessionManager::addAccount(AccountHandler* pHandler) { @@ -832,7 +895,7 @@ } else { - DELETEP(pHandler); + _deleteAccount(pHandler); UT_DEBUGMSG(("User attempted to add duplicate account - request ignored.\n")); } @@ -844,14 +907,14 @@ for (UT_uint32 i = 0; i < m_vecAccounts.getItemCount(); i++) { AccountHandler * pHandler = m_vecAccounts.getNthItem(i); - DELETEP(pHandler); + _deleteAccount(pHandler); } m_vecAccounts.clear(); } -void AbiCollabSessionManager::destroyAccount(AccountHandler* pHandler) +bool AbiCollabSessionManager::destroyAccount(AccountHandler* pHandler) { - UT_return_if_fail(pHandler); + UT_return_val_if_fail(pHandler, false); for (UT_uint32 i = 0; i < m_vecAccounts.getItemCount(); i++) { @@ -883,10 +946,11 @@ } m_vecAccounts.deleteNthItem(i); - DELETEP(pHandler); - break; + _deleteAccount(pHandler); + return true; } } + return false; } void AbiCollabSessionManager::setDocumentHandles(Buddy& buddy, const UT_GenericVector& vDocHandles) @@ -982,13 +1046,10 @@ } } -bool AbiCollabSessionManager::processPacket(AccountHandler& handler, Packet* packet, const UT_UTF8String& sBuddyName) +bool AbiCollabSessionManager::processPacket(AccountHandler& handler, Packet* packet, Buddy* buddy) { UT_DEBUGMSG(("AbiCollabSessionManager::processPacket()\n")); UT_return_val_if_fail(packet, false); - - // TODO: it is rather inefficient to request a buddy for every packet - Buddy* buddy = handler.getBuddy(sBuddyName); UT_return_val_if_fail(buddy, false); // check if this is a simple import-meh-now-packet @@ -1085,6 +1146,10 @@ { if (!isLocallyControlled(pSession->getDocument())) { + UT_UTF8String docName = pSession->getDocument()->getFilename(); + if (docName == "") + docName = "Untitled"; // TODO: fetch the title from the frame somehow (which frame?) - MARCM + // the server hosting this session is gone, so let's disconnect as well if (!destroySession(pSession)) UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); @@ -1098,7 +1163,7 @@ UT_return_val_if_fail(pFrame, true); UT_UTF8String msg; // TODO: make this localizable - UT_UTF8String_sprintf(msg, "This document is not being shared anymore by %s. You are disconnected from the collaboration session.", buddy->getName().utf8_str()); + UT_UTF8String_sprintf(msg, "Document %s is not being shared anymore by buddy %s. You are disconnected from the collaboration session.", docName.utf8_str(), buddy->getName().utf8_str()); pFrame->showMessageBox(msg.utf8_str(), XAP_Dialog_MessageBox::b_O, XAP_Dialog_MessageBox::a_OK); } else @@ -1115,14 +1180,11 @@ case PCT_AccountAddBuddyRequestEvent: { - // TODO: it is rather inefficient to request a buddy for every packet - Buddy* pBuddy = handler.getBuddy(sBuddyName); - if (!pBuddy) + if (buddy != handler.getBuddy(buddy->getName())) { PropertyMap vBuddyProps; - vBuddyProps.insert(PropertyMap::value_type("name", sBuddyName.utf8_str())); + vBuddyProps.insert(PropertyMap::value_type("name", buddy->getName().utf8_str())); Buddy* pBuddy = handler.constructBuddy(vBuddyProps); - if (pBuddy) { // TODO: we don't handle request authorization yet. For now, just @@ -1190,3 +1252,121 @@ pListener->signal(event, pSource); } } + +void AbiCollabSessionManager::beginAsyncOperation(AbiCollab* pSession) +{ + UT_DEBUGMSG(("AbiCollabSessionManager::beginAsyncOperation(AbiCollab*)\n")); + UT_return_if_fail(pSession); + m_asyncSessionOps[pSession]++; +} + +void AbiCollabSessionManager::endAsyncOperation(AbiCollab* pSession) +{ + UT_DEBUGMSG(("AbiCollabSessionManager::endAsyncOperation(AbiCollab*)\n")); + UT_return_if_fail(pSession); + UT_return_if_fail(m_asyncSessionOps[pSession] > 0); + m_asyncSessionOps[pSession]--; +} + +void AbiCollabSessionManager::beginAsyncOperation(AccountHandler* pAccount) +{ + UT_DEBUGMSG(("AbiCollabSessionManager::beginAsyncOperation(AccountHandler*)\n")); + UT_return_if_fail(pAccount); + m_asyncAccountOps[pAccount]++; +} + +void AbiCollabSessionManager::endAsyncOperation(AccountHandler* pAccount) +{ + UT_DEBUGMSG(("AbiCollabSessionManager::endAsyncOperation(AccountHandler*)\n")); + UT_return_if_fail(pAccount); + UT_return_if_fail(m_asyncAccountOps[pAccount] > 0); + m_asyncAccountOps[pAccount]--; +} + +bool AbiCollabSessionManager::_setupFrame(XAP_Frame** pFrame, PD_Document* pDoc) +{ + UT_return_val_if_fail(pFrame, false); + + if (*pFrame) + { + UT_DEBUGMSG(("Frame is non-NULL, NOT loading document in the frame\n")); + return true; + } + + // if the document doesn't belong to a frame already, then create a + // new frame for this session (except when the document in the current + // frame is not dirty, doesn't have a filename yet (which means it + // is a brand new empty document), and isn't being shared at the moment) + XAP_Frame* pCurFrame = XAP_App::getApp()->getLastFocussedFrame(); + UT_return_val_if_fail(pCurFrame, false); + + PD_Document * pFrameDoc = static_cast(pCurFrame->getCurrentDoc()); + if (pFrameDoc != pDoc) + { + if (!pFrameDoc || (!pFrameDoc->getFilename() && !pFrameDoc->isDirty() && !isInSession(pFrameDoc))) + { + // we can replace the document in this frame safely, as it is + // brand new, and doesn't have any contents yet + } + else + { + // the current frame has already a document loaded, let's create + // a new frame + pCurFrame = XAP_App::getApp()->newFrame(); + } + + } + else + UT_DEBUGMSG(("This document is already in the current frame; using this frame\n")); + + UT_return_val_if_fail(pCurFrame, false); + *pFrame = pCurFrame; + + // load the document in the frame; this will also delete the old document (or at least, it should) + if (static_cast((*pFrame)->getCurrentDoc()) != pDoc) + { + UT_DEBUGMSG(("Loading the document in the frame\n")); + (*pFrame)->loadDocument(pDoc); + } + else + UT_DEBUGMSG(("Not loading the document in the frame, as the frame already has it\n")); + + return true; +} + +void AbiCollabSessionManager::_deleteSession(AbiCollab* pSession) +{ + UT_DEBUGMSG(("Waiting for all async actions to complete...\n")); + UT_return_if_fail(pSession); + // wait for all async actions to complete + // TODO: some sort of feedback to the user would be nice + while (m_asyncSessionOps[pSession] > 0) + _nullUpdate(); + DELETEP(pSession); +} + +void AbiCollabSessionManager::_deleteAccount(AccountHandler* pHandler) +{ + UT_DEBUGMSG(("Waiting for all async actions to complete...\n")); + UT_return_if_fail(pHandler); + // wait for all async actions to complete + // TODO: some sort of feedback to the user would be nice + while (m_asyncAccountOps[pHandler] > 0) + _nullUpdate(); + DELETEP(pHandler); +} + +void AbiCollabSessionManager::_nullUpdate() +{ +#ifdef WIN32 + MSG msg; + for (UT_sint32 i = 0 ; i < 10 ; i++ ) + if (PeekMessage(&msg, (HWND) NULL, 0, 0, PM_REMOVE)) + DispatchMessage(&msg); + Sleep(10); +#else + for (UT_sint32 i = 0; (i < 10) && gtk_events_pending(); i++) + gtk_main_iteration (); + usleep(1000*10); +#endif +} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollabSessionManager.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollabSessionManager.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/AbiCollabSessionManager.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/AbiCollabSessionManager.h 2008-07-13 13:05:15.000000000 +0100 @@ -21,6 +21,7 @@ #ifndef ABICOLLABSESSIONMANAGER_H #define ABICOLLABSESSIONMANAGER_H +#include #include #include #include "ut_types.h" @@ -42,7 +43,7 @@ class Event; class EventListener; -class ABI_EXPORT AbiCollabSessionManager +class AbiCollabSessionManager { public: static AbiCollabSessionManager* getManager(); @@ -51,7 +52,7 @@ // helper functions static UT_Error serializeDocument(const PD_Document* pDoc, std::string& document, bool encodeBase64=true ); - static UT_Error deserializeDocument(PD_Document** pDoc, std::string& document, bool isEncodedBase64=true); + static UT_Error deserializeDocument(PD_Document** pDoc, const std::string& document, bool isEncodedBase64=true); // dialog code bool registerDialogs(void); @@ -87,16 +88,19 @@ AbiCollab* getSessionFromSessionId(const UT_UTF8String& sSessionId); const UT_GenericVector& getSessions(void) const { return m_vecSessions;} - AbiCollab* startSession(PD_Document* pDoc, UT_UTF8String& sNewSessionId); + AbiCollab* startSession(PD_Document* pDoc, UT_UTF8String& sNewSessionId, XAP_Frame* pFrame); void closeSession(AbiCollab* pSession, bool canConfirm); void closeSessions(); void joinSessionInitiate(Buddy* pBuddy, DocHandle* pDocHandle); - void joinSession(const UT_UTF8String& sSessionId, PD_Document* pDoc, const UT_UTF8String& docUUID, UT_sint32 iRev, Buddy* pCollaborator); + void joinSession(const UT_UTF8String& sSessionId, PD_Document* pDoc, + const UT_UTF8String& docUUID, UT_sint32 iRev, Buddy* pCollaborator, + XAP_Frame *pFrame); void joinSession(AbiCollab* pSession, Buddy* pCollaborator); void disjoinSession(const UT_UTF8String& sSessionId); bool isLocallyControlled(PD_Document* pDoc); bool isInSession(PD_Document* pDoc); bool isActive(const UT_UTF8String& sSessionId); + void removeBuddy(const Buddy* pBuddy, bool graceful = true); // account code bool registerAccountHandlers(void); @@ -108,22 +112,34 @@ const UT_GenericVector& getAccounts() const { return m_vecAccounts; } void destroyAccounts(); - void destroyAccount(AccountHandler* pHandler); + bool destroyAccount(AccountHandler* pHandler); void setDocumentHandles(Buddy& buddy, const UT_GenericVector& vDocHandle); // packet handling - bool processPacket(AccountHandler& handler, Packet* pPacket, const UT_UTF8String& sBuddyName); + bool processPacket(AccountHandler& handler, Packet* pPacket, Buddy* buddy); // signalling code void registerEventListener(EventListener* pListener); void unregisterEventListener(EventListener* pListener); void signal(const Event& event, const Buddy* pSource = 0); + // asynchronous operation handling + void beginAsyncOperation(AbiCollab* pSession); + void endAsyncOperation(AbiCollab* pSession); + void beginAsyncOperation(AccountHandler* pSession); + void endAsyncOperation(AccountHandler* pSession); AbiCollabSessionManager(void); // TODO: this constructor shouldn't be public private: - static AbiCollabSessionManager* m_pManager; + bool _setupFrame(XAP_Frame** pFrame, PD_Document* pDoc); + + // asynchronous operation handling + void _deleteSession(AbiCollab* pSession); + void _deleteAccount(AccountHandler* pHandler); + void _nullUpdate(); + + static AbiCollabSessionManager* m_pManager; // dialog code XAP_Dialog_Id m_iDialogJoin; @@ -142,6 +158,10 @@ UT_GenericVector m_regAccountHandlers; UT_GenericVector m_vecAccounts; UT_GenericVector m_vecEventListeners; + + // asynchronous opertation registration + std::map m_asyncSessionOps; + std::map m_asyncAccountOps; }; #endif /* ABICOLLABSESSIONMANAGER_H */ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/DiskSessionRecorder.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/DiskSessionRecorder.cpp --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/DiskSessionRecorder.cpp 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/DiskSessionRecorder.cpp 2008-07-13 13:05:15.000000000 +0100 @@ -204,6 +204,7 @@ DELETEP(rp); } } + return true; } void DiskSessionRecorder::destroy() diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/DiskSessionRecorder.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/DiskSessionRecorder.h --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/DiskSessionRecorder.h 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/DiskSessionRecorder.h 2008-07-13 13:05:15.000000000 +0100 @@ -32,7 +32,7 @@ #include -class ABI_EXPORT RecordedPacket +class RecordedPacket { public: RecordedPacket(bool bIncoming,bool bHasBuddy, const UT_UTF8String& buddyName, UT_uint64 timestamp, Packet* pPacket) @@ -58,7 +58,7 @@ bool m_bDeleteAtDestroy; }; -class ABI_EXPORT DiskSessionRecorder : public SessionRecorderInterface +class DiskSessionRecorder : public SessionRecorderInterface { public: DiskSessionRecorder(AbiCollab* pSession); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/GNUmakefile.in 2008-04-06 22:37:40.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/GNUmakefile.in 2008-07-13 14:10:01.000000000 +0100 @@ -119,6 +119,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/core/session/xp/Makefile 2008-04-06 22:36:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/core/session/xp/Makefile 2008-07-13 13:05:15.000000000 +0100 @@ -2,6 +2,7 @@ ## AbiWord ## Copyright (C) 1998 AbiSource, Inc. +## Copyright (C) 2008 by Marc Maurer ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License @@ -20,6 +21,7 @@ ABI_ROOT:=$(shell pwd)/../../../../../../abi include $(ABI_ROOT)/src/config/abi_defs.mk +include $(shell pwd)/../../../abicollab_config.mk TARGETS= $(OBJS) CPPSRCS= AbiCollab.cpp \ @@ -40,13 +42,14 @@ -I$(ABI_ROOT)/../libs/boost \ -I$(ABI_ROOT)/../libs/asio/include -#CFLAGS += -DABI_DLL +CFLAGS += -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers # compiler (MinGW, MSVC, etc) specific ifeq ($(OS_NAME),MINGW32) + INCLUDES += $(BACKEND_INCLUDES) else OS_CFLAGS+=-GX endif diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicollab/GNUmakefile.in 2008-04-06 22:37:35.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/GNUmakefile.in 2008-07-13 14:09:54.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/Makefile --- abiword-2.6.2/abiword-plugins/tools/abicollab/Makefile 2008-04-06 22:36:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/Makefile 2008-07-13 13:05:22.000000000 +0100 @@ -2,6 +2,7 @@ ## AbiWord ## Copyright (C) 1998 AbiSource, Inc. +## Copyright (C) 2008 AbiSource Corporation B.V. ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License @@ -20,6 +21,7 @@ ABI_ROOT:=$(shell pwd)/../../../abi include $(ABI_ROOT)/src/config/abi_defs.mk +include $(shell pwd)/abicollab_config.mk DIRS= core backends @@ -52,15 +54,35 @@ $(OBJDIR)/Buddy.$(OBJ_SUFFIX) \ $(OBJDIR)/Serialization.$(OBJ_SUFFIX) \ $(OBJDIR)/AbiCollab_Command.$(OBJ_SUFFIX) \ - $(OBJDIR)/TCPAccountHandler.$(OBJ_SUFFIX) \ - $(OBJDIR)/TCPWin32AccountHandler.$(OBJ_SUFFIX)\ - $(OBJDIR)/Synchronizer.$(OBJ_SUFFIX)\ + $(OBJDIR)/Synchronizer.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_Win32Res_CollaborationDialogsrc.$(OBJ_SUFFIX) +ifeq ($(BUILD_TCP_BACKEND),1) +OBJS+= $(OBJDIR)/TCPAccountHandler.$(OBJ_SUFFIX) \ + $(OBJDIR)/TCPWin32AccountHandler.$(OBJ_SUFFIX) +endif + +ifeq ($(BUILD_SERVICE_BACKEND),1) +OBJS+= $(OBJDIR)/ServiceAccountHandler.$(OBJ_SUFFIX) \ + $(OBJDIR)/AbiCollabImport.$(OBJ_SUFFIX) \ + $(OBJDIR)/AbiCollabSaveInterceptor.$(OBJ_SUFFIX) \ + $(OBJDIR)/AbiCollabService_Export.$(OBJ_SUFFIX) \ + $(OBJDIR)/RealmConnection.$(OBJ_SUFFIX) \ + $(OBJDIR)/RealmProtocol.$(OBJ_SUFFIX) \ + $(OBJDIR)/ap_Dialog_GenericInput.$(OBJ_SUFFIX) \ + $(OBJDIR)/ap_Dialog_GenericProgress.$(OBJ_SUFFIX) \ + $(OBJDIR)/ap_Win32Dialog_GenericInput.$(OBJ_SUFFIX) \ + $(OBJDIR)/ap_Win32Dialog_GenericProgress.$(OBJ_SUFFIX) \ + $(OBJDIR)/ServiceWin32AccountHandler.$(OBJ_SUFFIX) +endif + +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe EXTRA_LIBS+= $(shell pkg-config --libs libxml-2.0) + EXTRA_LIBS+= $(BACKEND_LIBS) EXTRA_LIBS+= -lws2_32 EXTRA_LIBS+= -lwsock32 EXTRA_LIBS+= -lgdi32 diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicollab/plugin.m4 /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicollab/plugin.m4 --- abiword-2.6.2/abiword-plugins/tools/abicollab/plugin.m4 2008-04-06 22:36:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicollab/plugin.m4 2008-07-13 13:05:22.000000000 +0100 @@ -178,21 +178,36 @@ # -# Checks for the collaborate.abisource.com service backend +# Checks for the abicollab.net service backend # -AC_ARG_WITH(abicollab-service-backend,[ --with-abicollab-service-backend enable the collaborate.abisource.com service backend for abicollab],[ +AC_ARG_WITH(abicollab-service-backend,[ --with-abicollab-service-backend enable the abicollab.net service backend for abicollab; NOTE to packagers: do NOT enable this, the service is not publically available yet],[ AC_CHECK_HEADERS(asio.hpp,[ - ABI_PLUGIN_REPORT([abicollab collaborate.abisource.com support: yes]) abicollab_handler_service=yes - ],[ ABI_PLUGIN_REPORT([abicollab collaborate.abisource.com support: no, asio >= 0.3.8rc1 required]) + ],[ ABI_PLUGIN_REPORT([abicollab abicollab.net support: no, asio >= 0.3.8rc1 required]) ]) + + if test "x$abicollab_handler_service" = "xyes" ; then + PKG_CHECK_MODULES(ABICOLLAB_SOUP, [libsoup-2.2 >= 2.2.100],[ + ABI_PLUGIN_REPORT([abicollab abicollab.net support: yes]) + abicollab_handler_service=yes + ],[ PKG_CHECK_MODULES(ABICOLLAB_SOUP, [libsoup-2.4 >= 2.4.1],[ + ABICOLLAB_SOUP_CFLAGS+=-DSOUP24 + ABI_PLUGIN_REPORT([abicollab abicollab.net support: yes]) + abicollab_handler_service=yes + ],[ + ABI_PLUGIN_REPORT([abicollab abicollab.net support: no, libsoup-2.2 >= 2.2.100 or libsoup-2.4 >= 2.4.1 required]) + abicollab_handler_service=no + ]) + ]) + fi + ],[ - ABI_PLUGIN_REPORT([abicollab collaborate.abisource.com support: no]) + ABI_PLUGIN_REPORT([abicollab abicollab.net support: no]) abicollab_handler_service=no ]) if test "x$abicollab_handler_service" = "xyes" ; then - ABICOLLAB_SERVICE_CPPFLAGS="-DABICOLLAB_HANDLER_SERVICE $ABICOLLAB_ASIO_CPPFLAGS" - ABICOLLAB_SERVICE_LIBS="-lpthread" + ABICOLLAB_SERVICE_CPPFLAGS="-DABICOLLAB_HANDLER_SERVICE $ABICOLLAB_ASIO_CPPFLAGS $ABICOLLAB_SOUP_CFLAGS" + ABICOLLAB_SERVICE_LIBS="-lpthread $ABICOLLAB_SOUP_LIBS" fi AC_SUBST(ABICOLLAB_SERVICE_CPPFLAGS) AC_SUBST(ABICOLLAB_SERVICE_LIBS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicommand/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicommand/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicommand/GNUmakefile.in 2008-04-06 22:37:40.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicommand/GNUmakefile.in 2008-07-13 14:10:01.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicommand/xp/AbiCommand.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicommand/xp/AbiCommand.h --- abiword-2.6.2/abiword-plugins/tools/abicommand/xp/AbiCommand.h 2008-04-06 22:36:38.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicommand/xp/AbiCommand.h 2008-07-13 13:04:52.000000000 +0100 @@ -29,7 +29,7 @@ class XAP_App; class UT_UTF8String; -class ABI_EXPORT AbiCommand +class AbiCommand { public: AbiCommand(void); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abicommand/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abicommand/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abicommand/xp/GNUmakefile.in 2008-04-06 22:37:40.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abicommand/xp/GNUmakefile.in 2008-07-13 14:10:02.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abidash/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abidash/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abidash/GNUmakefile.in 2008-04-06 22:37:40.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abidash/GNUmakefile.in 2008-07-13 14:10:02.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abidash/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abidash/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abidash/xp/GNUmakefile.in 2008-04-06 22:37:41.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abidash/xp/GNUmakefile.in 2008-07-13 14:10:02.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigimp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigimp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abigimp/GNUmakefile.in 2008-04-06 22:37:41.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigimp/GNUmakefile.in 2008-07-13 14:10:02.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigimp/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigimp/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abigimp/xp/GNUmakefile.in 2008-04-06 22:37:41.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigimp/xp/GNUmakefile.in 2008-07-13 14:10:02.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigoffice/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigoffice/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abigoffice/GNUmakefile.in 2008-04-06 22:37:41.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigoffice/GNUmakefile.in 2008-07-13 14:10:03.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/AbiGOChart.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/AbiGOChart.h --- abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/AbiGOChart.h 2008-04-06 22:36:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/AbiGOChart.h 2008-07-13 13:05:23.000000000 +0100 @@ -36,7 +36,7 @@ class GOChartView; class GR_AbiGOChartItems; -class ABI_EXPORT GR_AbiGOChartItems +class GR_AbiGOChartItems { public: GR_AbiGOChartItems(); @@ -45,7 +45,7 @@ bool m_bHasSnapshot; }; -class ABI_EXPORT GR_GOChartManager : public GR_EmbedManager +class GR_GOChartManager : public GR_EmbedManager { public: GR_GOChartManager(GR_Graphics * pG); @@ -94,7 +94,7 @@ }; // FIXME wrapper for libGNOMEOFFICEChart object -class ABI_EXPORT GOChartView +class GOChartView { public: GOChartView(GR_GOChartManager * pGOMan); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/AbiGOComponent.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/AbiGOComponent.h --- abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/AbiGOComponent.h 2008-04-06 22:36:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/AbiGOComponent.h 2008-07-13 13:05:23.000000000 +0100 @@ -32,7 +32,7 @@ class GOComponentView; class GR_AbiGOComponentItems; -class ABI_EXPORT GR_AbiGOComponentItems +class GR_AbiGOComponentItems { public: GR_AbiGOComponentItems(); @@ -41,7 +41,7 @@ bool m_bHasSnapshot; }; -class ABI_EXPORT GR_GOComponentManager : public GR_EmbedManager +class GR_GOComponentManager : public GR_EmbedManager { public: GR_GOComponentManager(GR_Graphics * pG, char const *mime_type); @@ -87,7 +87,7 @@ }; // FIXME wrapper for libGNOMEOFFICEComponent object -class ABI_EXPORT GOComponentView +class GOComponentView { friend class GR_GOComponentManager; public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/GNUmakefile.in 2008-04-06 22:37:41.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/GNUmakefile.in 2008-07-13 14:10:03.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/ie_imp_GOChart.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/ie_imp_GOChart.h --- abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/ie_imp_GOChart.h 2008-04-06 22:36:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/ie_imp_GOChart.h 2008-07-13 13:05:23.000000000 +0100 @@ -28,12 +28,12 @@ #include "ie_imp.h" #include "ut_mbtowc.h" #include "pd_Document.h" -class UT_ByteBuf; -class ImportStream; +class UT_ByteBuf; +class ImportStream; // The importer/reader for Embedable Objects. -class ABI_EXPORT IE_Imp_Object_Sniffer : public IE_ImpSniffer +class IE_Imp_Object_Sniffer : public IE_ImpSniffer { friend class IE_Imp; friend class IE_Imp_Object; @@ -68,7 +68,7 @@ // The importer/reader for GNOME-Office charts. -class ABI_EXPORT IE_Imp_Object : public IE_Imp +class IE_Imp_Object : public IE_Imp { public: IE_Imp_Object(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/ie_imp_GOComponent.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/ie_imp_GOComponent.h --- abiword-2.6.2/abiword-plugins/tools/abigoffice/unix/ie_imp_GOComponent.h 2008-04-06 22:36:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigoffice/unix/ie_imp_GOComponent.h 2008-07-13 13:05:23.000000000 +0100 @@ -29,14 +29,14 @@ #include "ut_mbtowc.h" #include "pd_Document.h" #include -class UT_ByteBuf; -class ImportStream; +class UT_ByteBuf; +class ImportStream; extern GSList *mime_types; // The importer/reader for Embedable Components. -class ABI_EXPORT IE_Imp_Component_Sniffer : public IE_ImpSniffer +class IE_Imp_Component_Sniffer : public IE_ImpSniffer { friend class IE_Imp; friend class IE_Imp_Component; @@ -69,7 +69,7 @@ // The importer/reader for GNOME-Office charts. -class ABI_EXPORT IE_Imp_Component : public IE_Imp +class IE_Imp_Component : public IE_Imp { public: IE_Imp_Component(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigrammar/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigrammar/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abigrammar/GNUmakefile.in 2008-04-06 22:37:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigrammar/GNUmakefile.in 2008-07-13 14:10:03.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigrammar/linkgrammarwrap/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigrammar/linkgrammarwrap/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abigrammar/linkgrammarwrap/GNUmakefile.in 2008-04-06 22:37:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigrammar/linkgrammarwrap/GNUmakefile.in 2008-07-13 14:10:03.000000000 +0100 @@ -86,6 +86,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigrammar/linkgrammarwrap/LinkGrammarWrap.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigrammar/linkgrammarwrap/LinkGrammarWrap.h --- abiword-2.6.2/abiword-plugins/tools/abigrammar/linkgrammarwrap/LinkGrammarWrap.h 2008-04-06 22:36:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigrammar/linkgrammarwrap/LinkGrammarWrap.h 2008-07-13 13:05:03.000000000 +0100 @@ -26,7 +26,7 @@ class PieceOfText; -class ABI_EXPORT LinkGrammarWrap +class LinkGrammarWrap { public: LinkGrammarWrap(void); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigrammar/linkgrammarwrap/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigrammar/linkgrammarwrap/Makefile --- abiword-2.6.2/abiword-plugins/tools/abigrammar/linkgrammarwrap/Makefile 2008-04-06 22:36:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigrammar/linkgrammarwrap/Makefile 2008-07-13 13:05:03.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= LinkGrammarWrap.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= $(shell pkg-config --cflags link-grammar) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigrammar/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigrammar/Makefile --- abiword-2.6.2/abiword-plugins/tools/abigrammar/Makefile 2008-04-06 22:36:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigrammar/Makefile 2008-07-13 13:05:03.000000000 +0100 @@ -32,6 +32,8 @@ $(OBJDIR)/AbiGrammarUtil.$(OBJ_SUFFIX) \ $(OBJDIR)/LinkGrammarWrap.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= $(shell pkg-config --libs link-grammar) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigrammar/xp/AbiGrammarCheck.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigrammar/xp/AbiGrammarCheck.h --- abiword-2.6.2/abiword-plugins/tools/abigrammar/xp/AbiGrammarCheck.h 2008-04-06 22:36:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigrammar/xp/AbiGrammarCheck.h 2008-07-13 13:05:02.000000000 +0100 @@ -27,7 +27,7 @@ class LinkGrammarWrap; class PieceOfText; -class ABI_EXPORT Abi_GrammarCheck +class Abi_GrammarCheck { public: Abi_GrammarCheck(void); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigrammar/xp/AbiGrammarUtil.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigrammar/xp/AbiGrammarUtil.h --- abiword-2.6.2/abiword-plugins/tools/abigrammar/xp/AbiGrammarUtil.h 2008-04-06 22:36:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigrammar/xp/AbiGrammarUtil.h 2008-07-13 13:05:02.000000000 +0100 @@ -23,7 +23,7 @@ #include "ut_types.h" #include "ut_vector.h" -class ABI_EXPORT AbiGrammarError +class AbiGrammarError { public: AbiGrammarError(void); @@ -34,7 +34,7 @@ UT_UTF8String m_sErrorDesc; }; -class ABI_EXPORT PieceOfText +class PieceOfText { public: PieceOfText(void); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigrammar/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigrammar/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abigrammar/xp/GNUmakefile.in 2008-04-06 22:37:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigrammar/xp/GNUmakefile.in 2008-07-13 14:10:03.000000000 +0100 @@ -96,6 +96,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abigrammar/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abigrammar/xp/Makefile --- abiword-2.6.2/abiword-plugins/tools/abigrammar/xp/Makefile 2008-04-06 22:36:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abigrammar/xp/Makefile 2008-07-13 13:05:02.000000000 +0100 @@ -26,6 +26,8 @@ AbiGrammarCheck.cpp \ AbiGrammarUtil.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= $(shell pkg-config --cflags link-grammar) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abimathview/GNUmakefile.in 2008-04-06 22:37:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/GNUmakefile.in 2008-07-13 14:10:04.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/GNUmakefile.in 2008-04-06 22:37:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/GNUmakefile.in 2008-07-13 14:10:04.000000000 +0100 @@ -77,6 +77,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/itex2MML.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/itex2MML.h --- abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/itex2MML.h 2008-04-06 22:36:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/itex2MML.h 2008-07-13 13:04:59.000000000 +0100 @@ -1,10 +1,12 @@ -/* itex2MML 1.1.8 - * itex2MML.h last modified 9/14/2005 +/* itex2MML 1.3.5 + * itex2MML.h last modified 2/29/2008 */ #ifndef ITEX2MML_H #define ITEX2MML_H +#define ITEX2MML_VERSION "1.3.5" + #ifdef __cplusplus extern "C" { #endif @@ -23,6 +25,7 @@ extern int itex2MML_filter (const char * buffer, unsigned long length); extern int itex2MML_html_filter (const char * buffer, unsigned long length); + extern int itex2MML_strict_html_filter (const char * buffer, unsigned long length); /* To change output methods: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/itex2MML.l /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/itex2MML.l --- abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/itex2MML.l 2008-04-06 22:36:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/itex2MML.l 2008-07-13 13:04:59.000000000 +0100 @@ -1,11 +1,11 @@ -/* itex2MML 1.2 - * itex2MML.l last modified 4/4/2007 +/* itex2MML 1.3.5 + * itex2MML.l last modified 2/29/2008 */ %{ %} %option noyywrap -%x MATH ATTRIBUTELIST BBOLD FRAKTUR CALLIGRAPHIC ROMAN PLAINTEXT INT1 INT2 INT3 MATHENV +%x MATH ATTRIBUTELIST BBOLD FRAKTUR CALLIGRAPHIC ROMAN PLAINTEXT INT1 INT2 INT3 MATHENV SVGENV %{ #include @@ -47,6 +47,7 @@ "$"{1,2} | "\\]" {BEGIN(INITIAL); return ENDMATH;} + "^" return SUP; "_" return SUB; "{"[\t\r\n ]*"}" return EMPTYMROW; @@ -134,6 +135,8 @@ "+" {if (itex2MML_rowposn==1) return UNARYPLUS; else {yylval=itex2MML_copy_string("+"); return MO;}} +"\\#" {yylval=itex2MML_copy_string("#"); return MOL;} + "," | ":" | "!" | @@ -145,9 +148,11 @@ "`" | "*" {yylval=itex2MML_copy_string(yytext); return MOL;} +"\\prime" {yylval=itex2MML_copy_string("′"); return MOLL;} "'" {yylval=itex2MML_copy_string("′"); return MOL;} "''" {yylval=itex2MML_copy_string("″"); return MOL;} "'''" {yylval=itex2MML_copy_string("‴"); return MOL;} +"''''" {yylval=itex2MML_copy_string("⁗"); return MOL;} "\\alpha" | "\\beta" | @@ -326,7 +331,7 @@ "\\curvearrowleft" {yylval=itex2MML_copy_string("⤺"); return MOL;} "\\curvearrowbotright" {yylval=itex2MML_copy_string("⤻"); return MOL;} "\\downdownarrows" {yylval=itex2MML_copy_string("⇊"); return MOL;} -"\\leftleftarrows" {yylval=itex2MML_copy_string("&leftleftarrow;"); return MOL;} +"\\leftleftarrows" {yylval=itex2MML_copy_string("⇇"); return MOL;} "\\leftrightarrows" {yylval=itex2MML_copy_string("⇆"); return MOL;} "\\righttoleftarrow" {yylval=itex2MML_copy_string("⟲"); return MOL;} "\\lefttorightarrow" {yylval=itex2MML_copy_string("⟳"); return MOL;} @@ -458,6 +463,7 @@ "\\nsupseteq" | "\\propto" | "\\equiv" | +"\\nequiv" | "\\frown" | "\\triangleright" | "\\ncong" | @@ -494,7 +500,6 @@ "\\div" | "\\rtimes" | "\\bot" | -"\\prime" | "\\therefore" | "\\thickapprox" | "\\thicksim" | @@ -554,6 +559,8 @@ "\\wp" | "\\Re" {yylval=itex2MML_copy2(yytext, ";"); if (yylval != itex2MML_empty_string) yylval[0]='&'; return MI;} +"\\Perp" | +"\\Vbar" {yylval=itex2MML_copy_string("⫫"); return MOL;} "\\Box" | "\\square" {yylval=itex2MML_copy_string("□"); return MOL;} "\\emptyset" | @@ -636,7 +643,7 @@ "\\bigodot" {yylval=itex2MML_copy_string("⨀"); return MOB;} "\\bigsqcup" {yylval=itex2MML_copy_string("⨆"); return MOB;} -"\\bigsuplus" {yylval=itex2MML_copy_string("⨄"); return MOB;} +"\\biguplus" {yylval=itex2MML_copy_string("⨄"); return MOB;} "\\wedge" {yylval=itex2MML_copy_string("∧"); return MOL;} "\\Wedge" | @@ -687,6 +694,7 @@ "\\overset" {return OVER;} "\\over" {return TEXOVER;} +"\\atop" {return TEXATOP;} "\\underoverset" {return UNDEROVER;} @@ -733,6 +741,8 @@ "\\mathfrak" | "\\mathfr" {BEGIN(FRAKTUR); return FRAK;} +"\\slash" {return SLASHED;} + "\\mathcal" {BEGIN(CALLIGRAPHIC); return CAL;} "\\begin" {BEGIN(MATHENV); return BEGINENV;} @@ -792,9 +802,11 @@ "\\href" {BEGIN(PLAINTEXT); return HREF;} - +"\\operatorname" | "\\mathop" {BEGIN(PLAINTEXT); return MATHOP;} +"\\includegraphics"(\[[^\]]*\])?\{[^}]*\} ; + "\\"[a-zA-Z]+ {yylval=itex2MML_copy_string(yytext+1); return MOP;} "\&"[a-zA-Z_][a-zA-Z0-9_]*";" | @@ -822,6 +834,12 @@ "\{aligned\}" {BEGIN(MATH); return ALIGNED;} "\{gathered\}" {BEGIN(MATH); return GATHERED;} "\{split\}" {BEGIN(MATH); return ALIGNED;} +"\{svg\}" {BEGIN(SVGENV); return SVG;} +} + +{ +"\\end\{svg\}" {BEGIN(MATH); return ENDSVG;} +[^\\]* {yylval=itex2MML_copy_string(yytext); BEGIN(SVGENV); return XMLSTRING;} } { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/itex2MML.y /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/itex2MML.y --- abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/itex2MML.y 2008-04-06 22:36:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/itex2MML.y 2008-07-13 13:04:59.000000000 +0100 @@ -1,5 +1,5 @@ -/* itex2MML 1.1.9 - * itex2MML.y last modified 1/28/2007 +/* itex2MML 1.3.2 + * itex2MML.y last modified 11/10/2007 */ %{ @@ -266,8 +266,8 @@ %} -%left TEXOVER -%token CHAR STARTMATH STARTDMATH ENDMATH MI MIB MN MO SUP SUB MROWOPEN MROWCLOSE LEFT RIGHT BIG BBIG BIGG BBIGG BIGL BBIGL BIGGL BBIGGL FRAC TFRAC MATHOP MOP MOL MOF PERIODDELIM OTHERDELIM LEFTDELIM RIGHTDELIM MOS MOB SQRT ROOT BINOM UNDER OVER OVERBRACE UNDERBRACE UNDEROVER TENSOR MULTI ARRAY COLSEP ROWSEP ARRAYOPTS COLLAYOUT COLALIGN ROWALIGN ALIGN EQROWS EQCOLS ROWLINES COLLINES FRAME PADDING ATTRLIST ITALICS BOLD RM BB ST END BBLOWERCHAR BBUPPERCHAR CALCHAR FRAKCHAR CAL FRAK ROWOPTS TEXTSIZE SCSIZE SCSCSIZE DISPLAY TEXTSTY TEXTBOX TEXTSTRING CELLOPTS ROWSPAN COLSPAN THINSPACE MEDSPACE THICKSPACE QUAD QQUAD NEGSPACE PHANTOM HREF UNKNOWNCHAR EMPTYMROW STATLINE TOGGLE FGHIGHLIGHT BGHIGHLIGHT SPACE INTONE INTTWO INTTHREE BAR WIDEBAR VEC WIDEVEC HAT WIDEHAT CHECK WIDECHECK TILDE WIDETILDE DOT DDOT UNARYMINUS UNARYPLUS BEGINENV ENDENV MATRIX PMATRIX BMATRIX BBMATRIX VMATRIX VVMATRIX SMALLMATRIX CASES ALIGNED GATHERED SUBSTACK PMOD RMCHAR COLOR BGCOLOR +%left TEXOVER TEXATOP +%token CHAR STARTMATH STARTDMATH ENDMATH MI MIB MN MO SUP SUB MROWOPEN MROWCLOSE LEFT RIGHT BIG BBIG BIGG BBIGG BIGL BBIGL BIGGL BBIGGL FRAC TFRAC MATHOP MOP MOL MOLL MOF PERIODDELIM OTHERDELIM LEFTDELIM RIGHTDELIM MOS MOB SQRT ROOT BINOM UNDER OVER OVERBRACE UNDERBRACE UNDEROVER TENSOR MULTI ARRAY COLSEP ROWSEP ARRAYOPTS COLLAYOUT COLALIGN ROWALIGN ALIGN EQROWS EQCOLS ROWLINES COLLINES FRAME PADDING ATTRLIST ITALICS BOLD SLASHED RM BB ST END BBLOWERCHAR BBUPPERCHAR CALCHAR FRAKCHAR CAL FRAK ROWOPTS TEXTSIZE SCSIZE SCSCSIZE DISPLAY TEXTSTY TEXTBOX TEXTSTRING XMLSTRING CELLOPTS ROWSPAN COLSPAN THINSPACE MEDSPACE THICKSPACE QUAD QQUAD NEGSPACE PHANTOM HREF UNKNOWNCHAR EMPTYMROW STATLINE TOGGLE FGHIGHLIGHT BGHIGHLIGHT SPACE INTONE INTTWO INTTHREE BAR WIDEBAR VEC WIDEVEC HAT WIDEHAT CHECK WIDECHECK TILDE WIDETILDE DOT DDOT UNARYMINUS UNARYPLUS BEGINENV ENDENV MATRIX PMATRIX BMATRIX BBMATRIX VMATRIX VVMATRIX SVG ENDSVG SMALLMATRIX CASES ALIGNED GATHERED SUBSTACK PMOD RMCHAR COLOR BGCOLOR %% @@ -543,6 +543,7 @@ | rmchars | bbold | frak +| slashed | cal | space | textstring @@ -560,6 +561,7 @@ | bghighlight | color | texover +| texatop | MROWOPEN closedTerm MROWCLOSE { $$ = itex2MML_copy_string($2); itex2MML_free_string($2); @@ -662,7 +664,7 @@ $$ = itex2MML_copy3("", $2, ""); itex2MML_free_string($2); } -BIGL LEFTDELIM { +|BIGL LEFTDELIM { itex2MML_rowposn = 2; $$ = itex2MML_copy3("", $2, ""); itex2MML_free_string($2); @@ -743,6 +745,11 @@ $$ = itex2MML_copy3("", $1, ""); itex2MML_free_string($1); } +| MOLL { + itex2MML_rowposn = 2; + $$ = itex2MML_copy3("", $1, ""); + itex2MML_free_string($1); +} | RIGHTDELIM { $$ = itex2MML_copy3("", $1, ""); itex2MML_free_string($1); @@ -877,6 +884,11 @@ itex2MML_free_string($2); }; +slashed: SLASHED closedTerm { + $$ = itex2MML_copy3("", $2, ""); + itex2MML_free_string($2); +}; + bold: BOLD closedTerm { $$ = itex2MML_copy3("", $2, ""); itex2MML_free_string($2); @@ -913,7 +925,7 @@ }; bbletter: BBLOWERCHAR { - $$ = itex2MML_copy_string($1); + $$ = itex2MML_copy3("&", $1, "opf;"); itex2MML_free_string($1); } | BBUPPERCHAR { @@ -1109,9 +1121,30 @@ itex2MML_free_string($5); }; +texatop: MROWOPEN compoundTermList TEXATOP compoundTermList MROWCLOSE { + char * s1 = itex2MML_copy3("", $2, ""); + $$ = itex2MML_copy3(s1, $4, ""); + itex2MML_free_string(s1); + itex2MML_free_string($2); + itex2MML_free_string($4); +} +| left compoundTermList TEXATOP compoundTermList right { + char * s1 = itex2MML_copy3("", $1, ""); + char * s2 = itex2MML_copy3($2, "", $4); + char * s3 = itex2MML_copy3("", $5, ""); + $$ = itex2MML_copy3(s1, s2, s3); + itex2MML_free_string(s1); + itex2MML_free_string(s2); + itex2MML_free_string(s3); + itex2MML_free_string($1); + itex2MML_free_string($2); + itex2MML_free_string($4); + itex2MML_free_string($5); +}; + binom: BINOM closedTerm closedTerm { - char * s1 = itex2MML_copy3("", $2, $3); - $$ = itex2MML_copy2(s1, ""); + char * s1 = itex2MML_copy3("(", $2, $3); + $$ = itex2MML_copy2(s1, ")"); itex2MML_free_string(s1); itex2MML_free_string($2); itex2MML_free_string($3); @@ -1165,11 +1198,11 @@ }; check: CHECK closedTerm { - $$ = itex2MML_copy3("", $2, "¯"); + $$ = itex2MML_copy3("", $2, "ˇ"); itex2MML_free_string($2); } | WIDECHECK closedTerm { - $$ = itex2MML_copy3("", $2, "¯"); + $$ = itex2MML_copy3("", $2, "ˇ"); itex2MML_free_string($2); }; @@ -1259,6 +1292,13 @@ | BEGINENV ALIGNED tableRowList ENDENV ALIGNED { $$ = itex2MML_copy3("", $3, ""); itex2MML_free_string($3); +} +| BEGINENV SVG XMLSTRING ENDSVG { + $$ = itex2MML_copy3("", $3, ""); + itex2MML_free_string($3); +} +| BEGINENV SVG ENDSVG { + $$ = itex2MML_copy_string(" "); }; substack: SUBSTACK MROWOPEN tableRowList MROWCLOSE { @@ -1536,6 +1576,16 @@ int itex2MML_html_filter (const char * buffer, unsigned long length) { + itex2MML_do_html_filter (buffer, length, 0); +} + +int itex2MML_strict_html_filter (const char * buffer, unsigned long length) +{ + itex2MML_do_html_filter (buffer, length, 1); +} + +int itex2MML_do_html_filter (const char * buffer, unsigned long length, const int forbid_markup) +{ int result = 0; int type = 0; @@ -1602,7 +1652,7 @@ { case '<': case '>': - skip = 1; + if (forbid_markup == 1) skip = 1; break; case '\\': diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/README.itex2MML /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/README.itex2MML --- abiword-2.6.2/abiword-plugins/tools/abimathview/itex2MML/README.itex2MML 2008-04-06 22:36:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/itex2MML/README.itex2MML 2008-07-13 13:04:59.000000000 +0100 @@ -7,7 +7,7 @@ it). Our changes were accepted 'upstream', followed by a new release dubbed itex2MLL 1.0 [3]. -Currently, we include itex2MML 1.2, without any modifications. +Currently, we include itex2MML 1.3.5, without any modifications. Some documentation can be found here [4]. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/Makefile --- abiword-2.6.2/abiword-plugins/tools/abimathview/Makefile 2008-04-06 22:36:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/Makefile 2008-07-13 13:05:01.000000000 +0100 @@ -40,6 +40,8 @@ $(OBJDIR)/y.tab.$(OBJ_SUFFIX) \ $(OBJDIR)/lex.yy.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= $(shell pkg-config --libs mathview-core mathview-frontend-libxml2) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/xp/AbiMathView.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/xp/AbiMathView.h --- abiword-2.6.2/abiword-plugins/tools/abimathview/xp/AbiMathView.h 2008-04-06 22:36:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/xp/AbiMathView.h 2008-07-13 13:05:00.000000000 +0100 @@ -35,7 +35,7 @@ class AD_Document; typedef SmartPtr GR_AbiMathView; -class ABI_EXPORT GR_AbiMathItems +class GR_AbiMathItems { public: GR_AbiMathItems(); @@ -44,7 +44,7 @@ bool m_bHasSnapshot; }; -class ABI_EXPORT GR_MathManager : public GR_EmbedManager +class GR_MathManager : public GR_EmbedManager { public: GR_MathManager(GR_Graphics * pG); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abimathview/xp/GNUmakefile.in 2008-04-06 22:37:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/xp/GNUmakefile.in 2008-07-13 14:10:04.000000000 +0100 @@ -98,6 +98,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/xp/gr_Abi_ComputerModernShaper.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/xp/gr_Abi_ComputerModernShaper.cpp --- abiword-2.6.2/abiword-plugins/tools/abimathview/xp/gr_Abi_ComputerModernShaper.cpp 2008-04-06 22:36:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/xp/gr_Abi_ComputerModernShaper.cpp 2008-07-13 13:05:00.000000000 +0100 @@ -51,7 +51,7 @@ static char fontFamily[128]; sprintf(fontFamily, "%s", getFamily()->nameOfFont(fontName, designSize).c_str()); - GR_Font* font = m_pGraphics->findFont(fontFamily, "normal", NULL, "normal", NULL, fontSize,NULL); + GR_Font* font = m_pGraphics->findFont(fontFamily, "normal", "", "normal", "", fontSize, ""); UT_ASSERT(font); return GR_Abi_CharArea::create(getGraphics(), font, size, toTTFGlyphIndex(getFamily()->encIdOfFontNameId(fontName), index)); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/xp/gr_Abi_DefaultShaper.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/xp/gr_Abi_DefaultShaper.cpp --- abiword-2.6.2/abiword-plugins/tools/abimathview/xp/gr_Abi_DefaultShaper.cpp 2008-04-06 22:36:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/xp/gr_Abi_DefaultShaper.cpp 2008-07-13 13:05:00.000000000 +0100 @@ -111,7 +111,7 @@ sprintf(fontSize, "%dpt", static_cast(context.getSize().toFloat() + 0.5f)); const AbiTextProperties& props = getTextProperties(variant); - GR_Font* font = m_pGraphics->findFont(props.family, props.style, NULL, props.weight, NULL, fontSize,NULL); + GR_Font* font = m_pGraphics->findFont(props.family, props.style, "", props.weight, "", fontSize, ""); UT_ASSERT(font); SmartPtr factory = smart_cast(context.getFactory()); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/xp/gr_Abi_RenderingContext.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/xp/gr_Abi_RenderingContext.cpp --- abiword-2.6.2/abiword-plugins/tools/abimathview/xp/gr_Abi_RenderingContext.cpp 2008-04-06 22:36:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/xp/gr_Abi_RenderingContext.cpp 2008-07-13 13:05:00.000000000 +0100 @@ -49,27 +49,11 @@ UT_sint32 GR_Abi_RenderingContext::toAbiLayoutUnits(const scaled& s) const { - if(!m_pGraphics) - return round((s * UT_LAYOUT_RESOLUTION) / 72.0).toInt(); - if( fabs(1.0 - m_pGraphics->getResolutionRatio()) > 0.01) - { - return round((s * (UT_LAYOUT_RESOLUTION * m_pGraphics->getResolutionRatio())) / 72.0).toInt(); - } - return round((s * UT_LAYOUT_RESOLUTION) / 72.0).toInt(); + return round((s * UT_LAYOUT_RESOLUTION) / 72.0).toInt(); } scaled GR_Abi_RenderingContext::fromAbiLayoutUnits(UT_sint32 s) const { - - if(!m_pGraphics) - { - return scaled((s * 72.0) / UT_LAYOUT_RESOLUTION); - } - - if( fabs(1.0 - m_pGraphics->getResolutionRatio()) > 0.01) - { - return scaled((s * 72.0) / (UT_LAYOUT_RESOLUTION * m_pGraphics->getResolutionRatio())); - } return scaled((s * 72.0) / UT_LAYOUT_RESOLUTION); } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/xp/gr_Abi_StandardSymbolsShaper.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/xp/gr_Abi_StandardSymbolsShaper.cpp --- abiword-2.6.2/abiword-plugins/tools/abimathview/xp/gr_Abi_StandardSymbolsShaper.cpp 2008-04-06 22:36:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/xp/gr_Abi_StandardSymbolsShaper.cpp 2008-07-13 13:05:00.000000000 +0100 @@ -45,7 +45,7 @@ static char fontSize[128]; sprintf(fontSize, "%dpt", static_cast(size.toFloat() + 0.5f)); - GR_Font* font = m_pGraphics->findFont("Symbol", "normal", NULL, "normal", NULL, fontSize,NULL); + GR_Font* font = m_pGraphics->findFont("Symbol", "normal", "", "normal", "", fontSize, ""); UT_ASSERT(font); UT_UCS4Char ch = static_cast(static_cast(index)); return factory->charArea(getGraphics(), font, size, ch); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/xp/ie_imp_MathML.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/xp/ie_imp_MathML.h --- abiword-2.6.2/abiword-plugins/tools/abimathview/xp/ie_imp_MathML.h 2008-04-06 22:36:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/xp/ie_imp_MathML.h 2008-07-13 13:05:00.000000000 +0100 @@ -30,15 +30,15 @@ #include "ut_vector.h" #include "pd_Document.h" -class UT_ByteBuf; -class ImportStream; +class UT_ByteBuf; +class ImportStream; typedef struct { - char * szEntity; - char * szVal; + const char * szEntity; + const char * szVal; } AbiMathViewEntityMapItem; -class ABI_EXPORT IE_Imp_MathML_EntityTable +class IE_Imp_MathML_EntityTable { public: IE_Imp_MathML_EntityTable (); @@ -53,7 +53,7 @@ // The importer/reader for MathML Files. -class ABI_EXPORT IE_Imp_MathML_Sniffer : public IE_ImpSniffer +class IE_Imp_MathML_Sniffer : public IE_ImpSniffer { friend class IE_Imp; friend class IE_Imp_MathML; @@ -88,7 +88,7 @@ // The importer/reader for MathML Files. -class ABI_EXPORT IE_Imp_MathML : public IE_Imp +class IE_Imp_MathML : public IE_Imp { public: IE_Imp_MathML(PD_Document * pDocument, const IE_Imp_MathML_EntityTable & EntityTable); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abimathview/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abimathview/xp/Makefile --- abiword-2.6.2/abiword-plugins/tools/abimathview/xp/Makefile 2008-04-06 22:36:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abimathview/xp/Makefile 2008-07-13 13:05:00.000000000 +0100 @@ -33,6 +33,8 @@ gr_Abi_StandardSymbolsShaper.cpp \ ie_imp_MathML.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= $(shell pkg-config --cflags glib-2.0 mathview-core mathview-frontend-libxml2) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abiscan/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abiscan/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abiscan/GNUmakefile.in 2008-04-06 22:37:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abiscan/GNUmakefile.in 2008-07-13 14:10:04.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/abiscan/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/abiscan/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/abiscan/unix/GNUmakefile.in 2008-04-06 22:37:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/abiscan/unix/GNUmakefile.in 2008-07-13 14:10:05.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/aiksaurus/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/aiksaurus/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/aiksaurus/GNUmakefile.in 2008-04-06 22:37:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/aiksaurus/GNUmakefile.in 2008-07-13 14:10:05.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/aiksaurus/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/aiksaurus/Makefile --- abiword-2.6.2/abiword-plugins/tools/aiksaurus/Makefile 2008-04-06 22:36:46.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/aiksaurus/Makefile 2008-07-13 13:05:09.000000000 +0100 @@ -29,6 +29,7 @@ OBJS= $(OBJDIR)/AiksaurusABI.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/aiksaurus/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/aiksaurus/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/aiksaurus/xp/GNUmakefile.in 2008-04-06 22:37:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/aiksaurus/xp/GNUmakefile.in 2008-07-13 14:10:05.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/babelfish/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/babelfish/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/babelfish/GNUmakefile.in 2008-04-06 22:37:43.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/babelfish/GNUmakefile.in 2008-07-13 14:10:05.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/babelfish/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/babelfish/Makefile --- abiword-2.6.2/abiword-plugins/tools/babelfish/Makefile 2008-04-06 22:36:37.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/babelfish/Makefile 2008-07-13 13:04:51.000000000 +0100 @@ -29,6 +29,7 @@ OBJS= $(OBJDIR)/AbiBabelfish.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/babelfish/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/babelfish/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/babelfish/xp/GNUmakefile.in 2008-04-06 22:37:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/babelfish/xp/GNUmakefile.in 2008-07-13 14:10:05.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/develop/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/develop/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/develop/GNUmakefile.in 2008-04-06 22:37:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/develop/GNUmakefile.in 2008-07-13 14:10:06.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/develop/gnu-regex/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/develop/gnu-regex/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/develop/gnu-regex/GNUmakefile.in 2008-04-06 22:37:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/develop/gnu-regex/GNUmakefile.in 2008-07-13 14:10:06.000000000 +0100 @@ -76,6 +76,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/develop/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/develop/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/develop/xp/GNUmakefile.in 2008-04-06 22:37:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/develop/xp/GNUmakefile.in 2008-07-13 14:10:06.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/freetranslation/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/freetranslation/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/freetranslation/GNUmakefile.in 2008-04-06 22:37:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/freetranslation/GNUmakefile.in 2008-07-13 14:10:06.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/freetranslation/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/freetranslation/Makefile --- abiword-2.6.2/abiword-plugins/tools/freetranslation/Makefile 2008-04-06 22:36:42.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/freetranslation/Makefile 2008-07-13 13:04:58.000000000 +0100 @@ -29,6 +29,7 @@ OBJS= $(OBJDIR)/AbiFreeTranslation.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/freetranslation/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/freetranslation/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/freetranslation/xp/GNUmakefile.in 2008-04-06 22:37:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/freetranslation/xp/GNUmakefile.in 2008-07-13 14:10:06.000000000 +0100 @@ -87,6 +87,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/gda/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/gda/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/gda/GNUmakefile.in 2008-04-06 22:37:45.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/gda/GNUmakefile.in 2008-07-13 14:10:07.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/gda/unix/AbiGDA.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/gda/unix/AbiGDA.cpp --- abiword-2.6.2/abiword-plugins/tools/gda/unix/AbiGDA.cpp 2008-04-06 22:36:39.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/gda/unix/AbiGDA.cpp 2008-07-13 13:04:53.000000000 +0100 @@ -70,7 +70,7 @@ * we'll open up a new window. If not, we'll act like the data * set got pasted in place */ -class ABI_EXPORT IE_Imp_GDA : public IE_Imp +class IE_Imp_GDA : public IE_Imp { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/gda/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/gda/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/gda/unix/GNUmakefile.in 2008-04-06 22:37:45.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/gda/unix/GNUmakefile.in 2008-07-13 14:10:07.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/gdict/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/gdict/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/gdict/GNUmakefile.in 2008-04-06 22:37:45.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/gdict/GNUmakefile.in 2008-07-13 14:10:07.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/gdict/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/gdict/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/gdict/unix/GNUmakefile.in 2008-04-06 22:37:45.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/gdict/unix/GNUmakefile.in 2008-07-13 14:10:07.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/GNUmakefile.in 2008-04-06 22:37:35.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/GNUmakefile.in 2008-07-13 14:09:53.000000000 +0100 @@ -66,6 +66,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/google/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/google/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/google/GNUmakefile.in 2008-04-06 22:37:45.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/google/GNUmakefile.in 2008-07-13 14:10:08.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/google/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/google/Makefile --- abiword-2.6.2/abiword-plugins/tools/google/Makefile 2008-04-06 22:36:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/google/Makefile 2008-07-13 13:05:23.000000000 +0100 @@ -29,6 +29,7 @@ OBJS= $(OBJDIR)/AbiGoogle.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/google/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/google/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/google/xp/GNUmakefile.in 2008-04-06 22:37:46.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/google/xp/GNUmakefile.in 2008-07-13 14:10:08.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/loadbindings/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/loadbindings/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/loadbindings/GNUmakefile.in 2008-04-06 22:37:46.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/loadbindings/GNUmakefile.in 2008-07-13 14:10:08.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/loadbindings/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/loadbindings/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/loadbindings/xp/GNUmakefile.in 2008-04-06 22:37:46.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/loadbindings/xp/GNUmakefile.in 2008-07-13 14:10:08.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/loadbindings/xp/LoadBindings.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/loadbindings/xp/LoadBindings.cpp --- abiword-2.6.2/abiword-plugins/tools/loadbindings/xp/LoadBindings.cpp 2008-04-06 22:36:39.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/loadbindings/xp/LoadBindings.cpp 2008-07-13 13:04:54.000000000 +0100 @@ -83,8 +83,11 @@ static XAP_Menu_Id dumpEditMethodsID; static XAP_Menu_Id saveBindingID; static const char * szLoadBinding = "Load keybindings"; +static const char * szLoadBindingStatus = "Load keybindings from a file"; static const char * szDumpEditMethods = "Dump edit methods"; +static const char * szDumpEditMethodsStatus = "Dump edit methods to your console"; static const char * szSaveBinding = "Save keybindings"; +static const char * szSaveBindingStatus = "Save keybindings to your profile directory"; static void LoadBindings_registerMethod () { @@ -113,7 +116,7 @@ #if defined(DEBUG) // add menu item loadBindingID = pFact->addNewMenuAfter("Main",NULL,AP_MENU_ID_FMT_STYLIST,EV_MLF_Normal); // named _FMT_, but actually in tools menu - pFact->addNewLabel(NULL,loadBindingID,szLoadBinding, NULL); + pFact->addNewLabel(NULL,loadBindingID,szLoadBinding,szLoadBindingStatus); EV_Menu_Action* myLoadBindingAction = new EV_Menu_Action( loadBindingID, // id that the layout said we could use 0, // no, we don't have a sub menu. @@ -128,7 +131,7 @@ // add menu item dumpEditMethodsID = pFact->addNewMenuAfter("Main",NULL,loadBindingID,EV_MLF_Normal); - pFact->addNewLabel(NULL,dumpEditMethodsID,szDumpEditMethods, NULL); + pFact->addNewLabel(NULL,dumpEditMethodsID,szDumpEditMethods,szDumpEditMethodsStatus); EV_Menu_Action* myDumpEditMethodsAction = new EV_Menu_Action( dumpEditMethodsID, // id that the layout said we could use 0, // no, we don't have a sub menu. @@ -143,7 +146,7 @@ // add menu item saveBindingID = pFact->addNewMenuAfter("Main",NULL,dumpEditMethodsID,EV_MLF_Normal); - pFact->addNewLabel(NULL,saveBindingID,szSaveBinding, NULL); + pFact->addNewLabel(NULL,saveBindingID,szSaveBinding,szSaveBindingStatus); EV_Menu_Action* mySaveBindingAction = new EV_Menu_Action( saveBindingID, // id that the layout said we could use 0, // no, we don't have a sub menu. @@ -337,7 +340,9 @@ // print them printf("%u bindable edit methods (don't require data)\n", list.size()); - for (size_t i=0; igetName()); + for (size_t i=0; igetName()); + return true; } static bool SaveBindings_invoke(AV_View * v, EV_EditMethodCallData* d) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/loadbindings/xp/LoadBindings.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/loadbindings/xp/LoadBindings.h --- abiword-2.6.2/abiword-plugins/tools/loadbindings/xp/LoadBindings.h 2008-04-06 22:36:39.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/loadbindings/xp/LoadBindings.h 2008-07-13 13:04:54.000000000 +0100 @@ -34,7 +34,7 @@ DONT_UNBIND_MOUSECONTEXTS = 0x01, DONT_UNBIND_KEYSTROKES = 0x02, - DONT_UNBIND_ANYTHING = 0x03, + DONT_UNBIND_ANYTHING = 0x03 }; enum _FROM_URI { FROM_URI }; @@ -43,7 +43,7 @@ typedef std::map UnbindMap; typedef std::map BindingMap; -class ABI_EXPORT LoadBindings +class LoadBindings { public: LoadBindings(EV_EditMethodCallData * d, _FROM_URI); @@ -90,7 +90,7 @@ void ReportWarning( const char* format, ... ) const; }; -class ABI_EXPORT EV_NamedVirtualKey +class EV_NamedVirtualKey { public: static const char * getName(EV_EditBits eb); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/ots/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/ots/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/ots/GNUmakefile.in 2008-04-06 22:37:46.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/ots/GNUmakefile.in 2008-07-13 14:10:09.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/ots/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/ots/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/ots/xp/GNUmakefile.in 2008-04-06 22:37:46.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/ots/xp/GNUmakefile.in 2008-07-13 14:10:09.000000000 +0100 @@ -88,6 +88,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/presentation/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/presentation/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/presentation/GNUmakefile.in 2008-04-06 22:37:46.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/presentation/GNUmakefile.in 2008-07-13 14:10:09.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/presentation/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/presentation/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/presentation/xp/GNUmakefile.in 2008-04-06 22:37:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/presentation/xp/GNUmakefile.in 2008-07-13 14:10:09.000000000 +0100 @@ -97,6 +97,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/presentation/xp/Presentation.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/presentation/xp/Presentation.cpp --- abiword-2.6.2/abiword-plugins/tools/presentation/xp/Presentation.cpp 2008-04-06 22:36:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/presentation/xp/Presentation.cpp 2008-07-13 13:05:22.000000000 +0100 @@ -79,6 +79,7 @@ EV_EditMouseContext PresentationContextID = EV_EMC_EMBED; static XAP_Menu_Id presentationID; static const char * szPresentation = "Presentation"; +static const char * szPresentationStatus = "View the document in presentation mode"; static const char * szNextSlide = "Next Slide"; static const char * szPrevSlide = "Previous Slide"; static XAP_Menu_Id nextSlideID; @@ -156,7 +157,7 @@ UT_DEBUGMSG(("presentationID %d \n",presentationID)); - pFact->addNewLabel(NULL,presentationID,szPresentation, NULL); + pFact->addNewLabel(NULL,presentationID,szPresentation,szPresentationStatus); // Create the Action that will be called. EV_Menu_Action* myPresentationAction = new EV_Menu_Action( @@ -415,14 +416,12 @@ { return true; } - // get the path where our app data is located + // get the path where our app data is located XAP_App * pApp = static_cast(XAP_App::getApp()); UT_String data_path( pApp->getAbiSuiteLibDir() ); -#if defined(WIN32) - data_path += "\\Presentation.xml"; -#else - data_path += "/Presentation.xml"; -#endif + data_path += G_DIR_SEPARATOR; + data_path += "Presentation.xml"; + EV_EditMethod * pLoadB = pEMC->findEditMethodByName ("com.abisource.abiword.loadbindings.fromURI"); g_return_val_if_fail (pLoadB != 0, false); EV_EditMethodCallData calldata(data_path.c_str(),data_path.size()); @@ -573,7 +572,7 @@ #endif bool Presentation::showNext(void) { - showNextPage(); + return showNextPage(); } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/presentation/xp/Presentation.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/presentation/xp/Presentation.h --- abiword-2.6.2/abiword-plugins/tools/presentation/xp/Presentation.h 2008-04-06 22:36:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/presentation/xp/Presentation.h 2008-07-13 13:05:22.000000000 +0100 @@ -31,7 +31,7 @@ class XAP_Frame; class GR_Image; -class ABI_EXPORT Presentation +class Presentation { public: Presentation(void); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/urldict/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/urldict/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/urldict/GNUmakefile.in 2008-04-06 22:37:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/urldict/GNUmakefile.in 2008-07-13 14:10:09.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/urldict/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/urldict/Makefile --- abiword-2.6.2/abiword-plugins/tools/urldict/Makefile 2008-04-06 22:36:44.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/urldict/Makefile 2008-07-13 13:05:05.000000000 +0100 @@ -29,6 +29,7 @@ OBJS= $(OBJDIR)/AbiURLDict.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/urldict/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/urldict/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/urldict/xp/GNUmakefile.in 2008-04-06 22:37:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/urldict/xp/GNUmakefile.in 2008-07-13 14:10:10.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/wikipedia/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/wikipedia/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/wikipedia/GNUmakefile.in 2008-04-06 22:37:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/wikipedia/GNUmakefile.in 2008-07-13 14:10:10.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/wikipedia/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/wikipedia/Makefile --- abiword-2.6.2/abiword-plugins/tools/wikipedia/Makefile 2008-04-06 22:36:45.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/wikipedia/Makefile 2008-07-13 13:05:06.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/AbiWikipedia.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/tools/wikipedia/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/tools/wikipedia/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/tools/wikipedia/xp/GNUmakefile.in 2008-04-06 22:37:47.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/tools/wikipedia/xp/GNUmakefile.in 2008-07-13 14:10:10.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/GNUmakefile.in 2008-04-06 22:37:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/GNUmakefile.in 2008-07-13 14:10:10.000000000 +0100 @@ -66,6 +66,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/applix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/applix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/applix/GNUmakefile.in 2008-04-06 22:37:50.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/applix/GNUmakefile.in 2008-07-13 14:10:13.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/applix/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/applix/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/applix/Makefile 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/applix/Makefile 2008-07-13 13:05:34.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_Applix.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impexp_Applix.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/GNUmakefile.in 2008-04-06 22:37:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/GNUmakefile.in 2008-07-13 14:10:14.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/ie_exp_Applix.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/ie_exp_Applix.h --- abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/ie_exp_Applix.h 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/ie_exp_Applix.h 2008-07-13 13:05:34.000000000 +0100 @@ -30,7 +30,7 @@ // the exporter/writer for Applix -class ABI_EXPORT IE_Exp_Applix_Sniffer : public IE_ExpSniffer +class IE_Exp_Applix_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -48,7 +48,7 @@ IE_Exp ** ppie); }; -class ABI_EXPORT IE_Exp_Applix : public IE_Exp +class IE_Exp_Applix : public IE_Exp { public: IE_Exp_Applix(PD_Document *pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/ie_imp_Applix.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/ie_imp_Applix.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/ie_imp_Applix.cpp 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/ie_imp_Applix.cpp 2008-07-13 13:05:34.000000000 +0100 @@ -79,11 +79,33 @@ UT_Confidence_t IE_Imp_Applix_Sniffer::recognizeContents(const char * szBuf, UT_uint32 iNumbytes) { - // this should be suffecient, at least for my liking - const char * magic = ""; + UT_uint32 iLinesToRead = 2; // Only examine the first few lines of the file + UT_uint32 iBytesScanned = 0; + const char *p = szBuf; + const char *magic; - if (!AX_STRN_CMP(szBuf, magic, strlen(magic))) - return UT_CONFIDENCE_PERFECT; + while( iLinesToRead-- ) + { + magic = ""; + if ( (iNumbytes - iBytesScanned) < strlen(magic) ) return(UT_CONFIDENCE_ZILCH); + if ( strncmp(p, magic, strlen(magic)) == 0 ) return(UT_CONFIDENCE_PERFECT); + + /* Seek to the next newline: */ + while ( *p != '\n' && *p != '\r' ) + { + iBytesScanned++; p++; + if( iBytesScanned+2 >= iNumbytes ) return(UT_CONFIDENCE_ZILCH); + } + /* Seek past the next newline: */ + if ( *p == '\n' || *p == '\r' ) + { + iBytesScanned++; p++; + if ( *p == '\n' || *p == '\r' ) + { + iBytesScanned++; p++; + } + } + } return UT_CONFIDENCE_ZILCH; } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/ie_imp_Applix.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/ie_imp_Applix.h --- abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/ie_imp_Applix.h 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/ie_imp_Applix.h 2008-07-13 13:05:34.000000000 +0100 @@ -34,7 +34,7 @@ // The importer/reader for Applix Word files -class ABI_EXPORT IE_Imp_Applix_Sniffer : public IE_ImpSniffer +class IE_Imp_Applix_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -54,7 +54,7 @@ }; -class ABI_EXPORT IE_Imp_Applix : public IE_Imp +class IE_Imp_Applix : public IE_Imp { public: IE_Imp_Applix(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/applix/xp/Makefile 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/applix/xp/Makefile 2008-07-13 13:05:34.000000000 +0100 @@ -26,6 +26,8 @@ ie_imp_Applix.cpp \ ie_impexp_Applix.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/GNUmakefile.in 2008-04-06 22:37:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/GNUmakefile.in 2008-07-13 14:10:14.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/Makefile 2008-04-06 22:37:07.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/Makefile 2008-07-13 13:05:45.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_imp_ClarisWorks.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/xp/GNUmakefile.in 2008-04-06 22:37:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/xp/GNUmakefile.in 2008-07-13 14:10:14.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/xp/ie_imp_ClarisWorks.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/xp/ie_imp_ClarisWorks.h --- abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/xp/ie_imp_ClarisWorks.h 2008-04-06 22:37:07.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/xp/ie_imp_ClarisWorks.h 2008-07-13 13:05:44.000000000 +0100 @@ -30,7 +30,7 @@ // The importer/reader for ClarisWorks/AppleWorks Files -class ABI_EXPORT IE_Imp_ClarisWorks_Sniffer : public IE_ImpSniffer +class IE_Imp_ClarisWorks_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -50,7 +50,7 @@ }; -class ABI_EXPORT IE_Imp_ClarisWorks : public IE_Imp +class IE_Imp_ClarisWorks : public IE_Imp { public: IE_Imp_ClarisWorks(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/clarisworks/xp/Makefile 2008-04-06 22:37:07.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/clarisworks/xp/Makefile 2008-07-13 13:05:44.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_imp_ClarisWorks.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/docbook/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/docbook/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/docbook/GNUmakefile.in 2008-04-06 22:37:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/docbook/GNUmakefile.in 2008-07-13 14:10:14.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/docbook/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/docbook/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/docbook/Makefile 2008-04-06 22:36:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/docbook/Makefile 2008-07-13 13:05:26.000000000 +0100 @@ -35,7 +35,7 @@ # it is not exported (stripped during build), so until it is used # we must link with object file [ut_png] for it. - +CFLAGS+= -DABI_DLL ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/docbook/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/docbook/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/docbook/xp/GNUmakefile.in 2008-04-06 22:37:51.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/docbook/xp/GNUmakefile.in 2008-07-13 14:10:14.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/docbook/xp/ie_exp_DocBook.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/docbook/xp/ie_exp_DocBook.h --- abiword-2.6.2/abiword-plugins/wp/impexp/docbook/xp/ie_exp_DocBook.h 2008-04-06 22:36:53.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/docbook/xp/ie_exp_DocBook.h 2008-07-13 13:05:25.000000000 +0100 @@ -32,7 +32,7 @@ // The exporter/writer for DocBook -class ABI_EXPORT IE_Exp_DocBook_Sniffer : public IE_ExpSniffer +class IE_Exp_DocBook_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -49,7 +49,7 @@ }; -class ABI_EXPORT IE_Exp_DocBook : public IE_Exp +class IE_Exp_DocBook : public IE_Exp { public: IE_Exp_DocBook(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/docbook/xp/ie_imp_DocBook.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/docbook/xp/ie_imp_DocBook.h --- abiword-2.6.2/abiword-plugins/wp/impexp/docbook/xp/ie_imp_DocBook.h 2008-04-06 22:36:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/docbook/xp/ie_imp_DocBook.h 2008-07-13 13:05:26.000000000 +0100 @@ -29,7 +29,7 @@ class PD_Document; -class ABI_EXPORT IE_Imp_DocBook_Sniffer : public IE_ImpSniffer +class IE_Imp_DocBook_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -51,7 +51,7 @@ // The importer/reader for DocBook files. -class ABI_EXPORT IE_Imp_DocBook : public IE_Imp_XML +class IE_Imp_DocBook : public IE_Imp_XML { public: IE_Imp_DocBook(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/docbook/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/docbook/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/docbook/xp/Makefile 2008-04-06 22:36:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/docbook/xp/Makefile 2008-07-13 13:05:26.000000000 +0100 @@ -27,6 +27,7 @@ ie_imp_DocBook.cpp \ ie_impexp_DocBook.cpp +CFLAGS+= -DABI_DLL include $(ABI_ROOT)/src/config/abi_rules.mk diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/eml/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/eml/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/eml/GNUmakefile.in 2008-04-06 22:37:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/eml/GNUmakefile.in 2008-07-13 14:10:15.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/eml/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/eml/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/eml/Makefile 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/eml/Makefile 2008-07-13 13:05:49.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_exp_EML.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/eml/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/eml/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/eml/xp/GNUmakefile.in 2008-04-06 22:37:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/eml/xp/GNUmakefile.in 2008-07-13 14:10:15.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/eml/xp/ie_exp_EML.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/eml/xp/ie_exp_EML.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/eml/xp/ie_exp_EML.cpp 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/eml/xp/ie_exp_EML.cpp 2008-07-13 13:05:49.000000000 +0100 @@ -27,7 +27,7 @@ #include "ut_string.h" #include "ut_assert.h" -//extern ABI_EXPORT IE_Exp_Text::; +//extern IE_Exp_Text::; /*****************************************************************/ /*****************************************************************/ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/eml/xp/ie_exp_EML.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/eml/xp/ie_exp_EML.h --- abiword-2.6.2/abiword-plugins/wp/impexp/eml/xp/ie_exp_EML.h 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/eml/xp/ie_exp_EML.h 2008-07-13 13:05:49.000000000 +0100 @@ -22,7 +22,7 @@ #include "ie_exp_Text.h" -class ABI_EXPORT IE_Exp_EML : public IE_Exp_Text +class IE_Exp_EML : public IE_Exp_Text { public: IE_Exp_EML(PD_Document * pDocument); @@ -31,7 +31,7 @@ virtual UT_Error _writeDocument(void); }; -class ABI_EXPORT IE_Exp_EML_Sniffer : public IE_ExpSniffer +class IE_Exp_EML_Sniffer : public IE_ExpSniffer { public: IE_Exp_EML_Sniffer (); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/eml/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/eml/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/eml/xp/Makefile 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/eml/xp/Makefile 2008-07-13 13:05:49.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_exp_EML.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/GNUmakefile.in 2008-04-06 22:37:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/GNUmakefile.in 2008-07-13 14:10:10.000000000 +0100 @@ -66,6 +66,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/bmp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/bmp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/bmp/GNUmakefile.in 2008-04-06 22:37:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/bmp/GNUmakefile.in 2008-07-13 14:10:15.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/bmp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/bmp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/bmp/Makefile 2008-04-06 22:37:03.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/bmp/Makefile 2008-07-13 13:05:40.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_impGraphic_BMP.$(OBJ_SUFFIX) \ +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/bmp/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/bmp/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/bmp/xp/GNUmakefile.in 2008-04-06 22:37:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/bmp/xp/GNUmakefile.in 2008-07-13 14:10:15.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/GNUmakefile.in 2008-04-06 22:37:52.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/GNUmakefile.in 2008-07-13 14:10:15.000000000 +0100 @@ -66,6 +66,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/jpeg/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/jpeg/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/jpeg/GNUmakefile.in 2008-04-06 22:37:53.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/jpeg/GNUmakefile.in 2008-07-13 14:10:16.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/jpeg/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/jpeg/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/jpeg/Makefile 2008-04-06 22:37:02.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/jpeg/Makefile 2008-07-13 13:05:38.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_impGraphic_JPEG.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/jpeg/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/jpeg/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/jpeg/xp/GNUmakefile.in 2008-04-06 22:37:53.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/jpeg/xp/GNUmakefile.in 2008-07-13 14:10:16.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/librsvg/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/librsvg/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/librsvg/GNUmakefile.in 2008-04-06 22:37:53.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/librsvg/GNUmakefile.in 2008-07-13 14:10:16.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/librsvg/unix/AbiRSVG.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/librsvg/unix/AbiRSVG.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/librsvg/unix/AbiRSVG.cpp 2008-04-06 22:37:02.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/librsvg/unix/AbiRSVG.cpp 2008-07-13 13:05:38.000000000 +0100 @@ -58,7 +58,7 @@ //------------------------------------------------------------------------------------ -class ABI_EXPORT IE_RSVGGraphic : public IE_ImpGraphic +class IE_RSVGGraphic : public IE_ImpGraphic { public: @@ -269,7 +269,7 @@ { "", UT_CONFIDENCE_ZILCH } }; -class ABI_EXPORT IE_RSVGGraphic_Sniffer : public IE_ImpGraphicSniffer +class IE_RSVGGraphic_Sniffer : public IE_ImpGraphicSniffer { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/librsvg/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/librsvg/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/librsvg/unix/GNUmakefile.in 2008-04-06 22:37:53.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/librsvg/unix/GNUmakefile.in 2008-07-13 14:10:16.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/win32native/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/win32native/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/win32native/GNUmakefile.in 2008-04-06 22:37:53.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/win32native/GNUmakefile.in 2008-07-13 14:10:17.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/win32native/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/win32native/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/win32native/Makefile 2008-04-06 22:37:02.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/win32native/Makefile 2008-07-13 13:05:39.000000000 +0100 @@ -30,6 +30,8 @@ OBJS= $(OBJDIR)/ie_impGraphic_Win32Native.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impGraphic_Win32GDIPlus.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/win32native/unix/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/win32native/unix/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/win32native/unix/GNUmakefile.in 2008-04-06 22:37:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/win32native/unix/GNUmakefile.in 2008-07-13 14:10:17.000000000 +0100 @@ -55,6 +55,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wmf/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wmf/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wmf/GNUmakefile.in 2008-04-06 22:37:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wmf/GNUmakefile.in 2008-07-13 14:10:17.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wmf/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wmf/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wmf/xp/GNUmakefile.in 2008-04-06 22:37:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wmf/xp/GNUmakefile.in 2008-07-13 14:10:17.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wpg/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wpg/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wpg/GNUmakefile.in 2008-04-06 22:37:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wpg/GNUmakefile.in 2008-07-13 14:10:18.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wpg/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wpg/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wpg/xp/GNUmakefile.in 2008-04-06 22:37:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wpg/xp/GNUmakefile.in 2008-07-13 14:10:18.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wpg/xp/ie_impGraphic_WPG.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wpg/xp/ie_impGraphic_WPG.h --- abiword-2.6.2/abiword-plugins/wp/impexp/graphics/wpg/xp/ie_impGraphic_WPG.h 2008-04-06 22:37:03.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/graphics/wpg/xp/ie_impGraphic_WPG.h 2008-07-13 13:05:39.000000000 +0100 @@ -23,7 +23,7 @@ #include #include "ie_impGraphic_SVG.h" -class ABI_EXPORT IE_Imp_WordPerfectGraphics_Sniffer : public IE_ImpGraphicSniffer +class IE_Imp_WordPerfectGraphics_Sniffer : public IE_ImpGraphicSniffer { friend class IE_Imp; friend class IE_Imp_WordPerfectGraphics; @@ -41,7 +41,7 @@ virtual UT_Error constructImporter(IE_ImpGraphic **ppieg); }; -class ABI_EXPORT IE_Imp_WordPerfectGraphics : public IE_ImpGraphic +class IE_Imp_WordPerfectGraphics : public IE_ImpGraphic { public: virtual UT_Error importGraphic(GsfInput *input, FG_Graphic **ppfg); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hancom/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hancom/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/hancom/GNUmakefile.in 2008-04-06 22:37:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hancom/GNUmakefile.in 2008-07-13 14:10:18.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hancom/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hancom/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/hancom/Makefile 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hancom/Makefile 2008-07-13 13:05:45.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_imp_hancom.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hancom/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hancom/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/hancom/xp/GNUmakefile.in 2008-04-06 22:37:55.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hancom/xp/GNUmakefile.in 2008-07-13 14:10:18.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hancom/xp/ie_imp_hancom.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hancom/xp/ie_imp_hancom.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/hancom/xp/ie_imp_hancom.cpp 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hancom/xp/ie_imp_hancom.cpp 2008-07-13 13:05:45.000000000 +0100 @@ -42,7 +42,7 @@ // ------------------------------------------------------------------------------------- // The importer -class ABI_EXPORT IE_Imp_Hancom : public IE_Imp { +class IE_Imp_Hancom : public IE_Imp { public: IE_Imp_Hancom(PD_Document *pDoc); virtual ~IE_Imp_Hancom(); @@ -122,7 +122,7 @@ { "", UT_CONFIDENCE_ZILCH } }; -class ABI_EXPORT IE_Imp_Hancom_Sniffer : public IE_ImpSniffer { +class IE_Imp_Hancom_Sniffer : public IE_ImpSniffer { public: IE_Imp_Hancom_Sniffer() : IE_ImpSniffer("AbiHancom:HWP:") diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hancom/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hancom/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/hancom/xp/Makefile 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hancom/xp/Makefile 2008-07-13 13:05:45.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_imp_hancom.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= $(ABI_GSF_INC) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/GNUmakefile.in 2008-04-06 22:37:55.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/GNUmakefile.in 2008-07-13 14:10:18.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/Makefile 2008-04-06 22:37:11.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/Makefile 2008-07-13 13:05:49.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_exp_HRText.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/xp/GNUmakefile.in 2008-04-06 22:37:55.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/xp/GNUmakefile.in 2008-07-13 14:10:18.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/xp/ie_exp_HRText.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/xp/ie_exp_HRText.h --- abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/xp/ie_exp_HRText.h 2008-04-06 22:37:11.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/xp/ie_exp_HRText.h 2008-07-13 13:05:49.000000000 +0100 @@ -28,7 +28,7 @@ // The exporter/writer for human readable text -class ABI_EXPORT IE_Exp_HRText_Sniffer : public IE_ExpSniffer +class IE_Exp_HRText_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -45,7 +45,7 @@ }; -class ABI_EXPORT IE_Exp_HRText : public IE_Exp +class IE_Exp_HRText : public IE_Exp { public: IE_Exp_HRText(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/hrtext/xp/Makefile 2008-04-06 22:37:11.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/hrtext/xp/Makefile 2008-07-13 13:05:49.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_exp_HRText.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/GNUmakefile.in 2008-04-06 22:37:55.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/GNUmakefile.in 2008-07-13 14:10:19.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/Makefile 2008-04-06 22:36:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/Makefile 2008-07-13 13:05:26.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_ISCII.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impexp_ISCII.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/xp/GNUmakefile.in 2008-04-06 22:37:55.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/xp/GNUmakefile.in 2008-07-13 14:10:19.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/xp/ie_exp_ISCII.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/xp/ie_exp_ISCII.h --- abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/xp/ie_exp_ISCII.h 2008-04-06 22:36:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/xp/ie_exp_ISCII.h 2008-07-13 13:05:26.000000000 +0100 @@ -24,7 +24,7 @@ // The exporter/writer for ISCII text files. -class ABI_EXPORT IE_Exp_ISCII_Sniffer : public IE_ExpSniffer +class IE_Exp_ISCII_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -40,7 +40,7 @@ IE_Exp ** ppie); }; -class ABI_EXPORT IE_Exp_ISCII : public IE_Exp_Text +class IE_Exp_ISCII : public IE_Exp_Text { public: IE_Exp_ISCII(PD_Document * pDocument) : IE_Exp_Text(pDocument) {} @@ -55,7 +55,7 @@ // into a text stream. ////////////////////////////////////////////////////////////////// -class ABI_EXPORT ISCII_Listener : public Text_Listener +class ISCII_Listener : public Text_Listener { public: ISCII_Listener(PD_Document * pDocument, IE_Exp_Text * pie) : Text_Listener(pDocument, pie) {} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/xp/ie_imp_ISCII.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/xp/ie_imp_ISCII.h --- abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/xp/ie_imp_ISCII.h 2008-04-06 22:36:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/xp/ie_imp_ISCII.h 2008-07-13 13:05:26.000000000 +0100 @@ -33,7 +33,7 @@ // ISCII file stream class -class ABI_EXPORT ImportISCIIStreamFile : public ImportStreamFile +class ImportISCIIStreamFile : public ImportStreamFile { public: ImportISCIIStreamFile(GsfInput *pFile); @@ -47,7 +47,7 @@ // The importer/reader for ISCII files. -class ABI_EXPORT IE_Imp_ISCII_Sniffer : public IE_ImpSniffer +class IE_Imp_ISCII_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -67,7 +67,7 @@ }; -class ABI_EXPORT IE_Imp_ISCII : public IE_Imp_Text +class IE_Imp_ISCII : public IE_Imp_Text { public: IE_Imp_ISCII(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/iscii-text/xp/Makefile 2008-04-06 22:36:54.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/iscii-text/xp/Makefile 2008-07-13 13:05:26.000000000 +0100 @@ -26,6 +26,8 @@ ie_imp_ISCII.cpp \ ie_impexp_ISCII.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/kword/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/kword/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/kword/GNUmakefile.in 2008-04-06 22:37:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/kword/GNUmakefile.in 2008-07-13 14:10:19.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/kword/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/kword/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/kword/Makefile 2008-04-06 22:36:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/kword/Makefile 2008-07-13 13:05:29.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_KWord_1.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impexp_KWord_1.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/kword/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/kword/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/kword/xp/GNUmakefile.in 2008-04-06 22:37:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/kword/xp/GNUmakefile.in 2008-07-13 14:10:19.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/kword/xp/ie_exp_KWord_1.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/kword/xp/ie_exp_KWord_1.h --- abiword-2.6.2/abiword-plugins/wp/impexp/kword/xp/ie_exp_KWord_1.h 2008-04-06 22:36:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/kword/xp/ie_exp_KWord_1.h 2008-07-13 13:05:29.000000000 +0100 @@ -32,7 +32,7 @@ // The exporter/writer for the KWord 1 spec -class ABI_EXPORT IE_Exp_KWord_1_Sniffer : public IE_ExpSniffer +class IE_Exp_KWord_1_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -50,7 +50,7 @@ IE_Exp ** ppie); }; -class ABI_EXPORT IE_Exp_KWord_1 : public IE_Exp +class IE_Exp_KWord_1 : public IE_Exp { public: IE_Exp_KWord_1(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/kword/xp/ie_imp_KWord_1.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/kword/xp/ie_imp_KWord_1.h --- abiword-2.6.2/abiword-plugins/wp/impexp/kword/xp/ie_imp_KWord_1.h 2008-04-06 22:36:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/kword/xp/ie_imp_KWord_1.h 2008-07-13 13:05:29.000000000 +0100 @@ -30,7 +30,7 @@ // The importer/reader for KWord 1.0 files. -class ABI_EXPORT IE_Imp_KWord_1_Sniffer : public IE_ImpSniffer +class IE_Imp_KWord_1_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -50,7 +50,7 @@ }; -class ABI_EXPORT IE_Imp_KWord_1 : public IE_Imp_XML +class IE_Imp_KWord_1 : public IE_Imp_XML { public: IE_Imp_KWord_1(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/kword/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/kword/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/kword/xp/Makefile 2008-04-06 22:36:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/kword/xp/Makefile 2008-07-13 13:05:29.000000000 +0100 @@ -26,6 +26,8 @@ ie_imp_KWord_1.cpp \ ie_impexp_KWord_1.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/latex/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/latex/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/latex/GNUmakefile.in 2008-04-06 22:37:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/latex/GNUmakefile.in 2008-07-13 14:10:19.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/latex/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/latex/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/latex/Makefile 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/latex/Makefile 2008-07-13 13:05:48.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_exp_LaTeX.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/latex/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/latex/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/latex/xp/GNUmakefile.in 2008-04-06 22:37:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/latex/xp/GNUmakefile.in 2008-07-13 14:10:20.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/latex/xp/ie_exp_LaTeX.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/latex/xp/ie_exp_LaTeX.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/latex/xp/ie_exp_LaTeX.cpp 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/latex/xp/ie_exp_LaTeX.cpp 2008-07-13 13:05:48.000000000 +0100 @@ -886,7 +886,7 @@ if (pszColor) { if ((0 != strcmp("000000", pszColor)) && - (0 != strcmp("000000", pszColor))) + (0 != strcmp("transparent", pszColor))) { UT_String szColor; _convertColor(szColor,(const char*)pszColor); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/latex/xp/ie_exp_LaTeX.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/latex/xp/ie_exp_LaTeX.h --- abiword-2.6.2/abiword-plugins/wp/impexp/latex/xp/ie_exp_LaTeX.h 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/latex/xp/ie_exp_LaTeX.h 2008-07-13 13:05:48.000000000 +0100 @@ -28,7 +28,7 @@ // The exporter/writer for LaTeX -class ABI_EXPORT IE_Exp_LaTeX_Sniffer : public IE_ExpSniffer +class IE_Exp_LaTeX_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -44,7 +44,7 @@ IE_Exp ** ppie); }; -class ABI_EXPORT IE_Exp_LaTeX : public IE_Exp +class IE_Exp_LaTeX : public IE_Exp { public: IE_Exp_LaTeX(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/latex/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/latex/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/latex/xp/Makefile 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/latex/xp/Makefile 2008-07-13 13:05:48.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_exp_LaTeX.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mif/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mif/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/mif/GNUmakefile.in 2008-04-06 22:37:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mif/GNUmakefile.in 2008-07-13 14:10:20.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mif/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mif/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/mif/Makefile 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mif/Makefile 2008-07-13 13:05:48.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_MIF.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impexp_MIF.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mif/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mif/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/mif/xp/GNUmakefile.in 2008-04-06 22:37:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mif/xp/GNUmakefile.in 2008-07-13 14:10:20.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mif/xp/ie_exp_MIF.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mif/xp/ie_exp_MIF.h --- abiword-2.6.2/abiword-plugins/wp/impexp/mif/xp/ie_exp_MIF.h 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mif/xp/ie_exp_MIF.h 2008-07-13 13:05:48.000000000 +0100 @@ -28,7 +28,7 @@ // the exporter/writer for MIF -class ABI_EXPORT IE_Exp_MIF_Sniffer : public IE_ExpSniffer +class IE_Exp_MIF_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -44,7 +44,7 @@ IE_Exp ** ppie); }; -class ABI_EXPORT IE_Exp_MIF : public IE_Exp +class IE_Exp_MIF : public IE_Exp { public: IE_Exp_MIF(PD_Document *pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mif/xp/ie_imp_MIF.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mif/xp/ie_imp_MIF.h --- abiword-2.6.2/abiword-plugins/wp/impexp/mif/xp/ie_imp_MIF.h 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mif/xp/ie_imp_MIF.h 2008-07-13 13:05:48.000000000 +0100 @@ -30,7 +30,7 @@ // The importer/reader for MIF files -class ABI_EXPORT IE_Imp_MIF_Sniffer : public IE_ImpSniffer +class IE_Imp_MIF_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -50,7 +50,7 @@ }; -class ABI_EXPORT IE_Imp_MIF : public IE_Imp +class IE_Imp_MIF : public IE_Imp { public: IE_Imp_MIF(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mif/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mif/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/mif/xp/Makefile 2008-04-06 22:37:10.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mif/xp/Makefile 2008-07-13 13:05:48.000000000 +0100 @@ -26,6 +26,8 @@ ie_imp_MIF.cpp \ ie_impexp_MIF.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/GNUmakefile.in 2008-04-06 22:37:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/GNUmakefile.in 2008-07-13 14:10:20.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/Makefile 2008-04-06 22:36:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/Makefile 2008-07-13 13:05:32.000000000 +0100 @@ -30,6 +30,8 @@ OBJS= $(OBJDIR)/ie_imp_MSWrite.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impexp_MSWrite.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/xp/GNUmakefile.in 2008-04-06 22:37:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/xp/GNUmakefile.in 2008-07-13 14:10:20.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/xp/ie_imp_MSWrite.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/xp/ie_imp_MSWrite.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/xp/ie_imp_MSWrite.cpp 2008-04-06 22:36:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/xp/ie_imp_MSWrite.cpp 2008-07-13 13:05:31.000000000 +0100 @@ -312,7 +312,7 @@ tab_count = 0; dxaLeft = dxaRight = dxaLeft1 = 0; - if (bfProp != 0xffff) { + if ((bfProp != 0xffff) && (bfProp + 13 < 0x80)) { cch = pap_page[bfProp + 4]; if (cch >= 2) { jc = pap_page[bfProp + 6] & 3; @@ -363,7 +363,6 @@ UT_LocaleTransactor lt (LC_NUMERIC, "C"); UT_String_sprintf (propBuffer, "text-align:%s; line-height:%.1f", text_align[jc], static_cast(dyaLine) / 240.0); - propBuffer += tempBuffer; /* tabs */ if (tab_count) { @@ -454,7 +453,7 @@ hps = 24; bold = italic = underline = hpsPos = 0; - if (bfProp != 0xffff) { + if ((bfProp != 0xffff) && (bfProp + 10 < 0x80)) { cch = char_page[bfProp + 4]; if (cch >= 2) @@ -500,7 +499,8 @@ } while (fcFirst2 >= fcFirst) { - if ((fcFirst2 >= fcLim) || (fcFirst2 >= fcLim2)) { + if ((fcFirst2 >= fcLim) || (fcFirst2 >= fcLim2) || + (fcFirst2 - 0x80 >= static_cast(mTextBuf.getLength()))) { break; } translate_char (*(mTextBuf.getPointer(fcFirst2 - 0x80)), mCharBuf); @@ -518,7 +518,7 @@ appendSpan (reinterpret_cast(mCharBuf.ucs4_str()), mCharBuf.size()); } else { - UT_DEBUGMSG (("Hub: Ingore 0 length span")); + UT_DEBUGMSG (("Hub: Ignoring 0 length span\n")); } } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/xp/ie_imp_MSWrite.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/xp/ie_imp_MSWrite.h --- abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/xp/ie_imp_MSWrite.h 2008-04-06 22:36:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/xp/ie_imp_MSWrite.h 2008-07-13 13:05:31.000000000 +0100 @@ -46,7 +46,7 @@ // The importer/reader for MS Write Files. -class ABI_EXPORT IE_Imp_MSWrite_Sniffer : public IE_ImpSniffer +class IE_Imp_MSWrite_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -67,7 +67,7 @@ }; -class ABI_EXPORT IE_Imp_MSWrite : public IE_Imp +class IE_Imp_MSWrite : public IE_Imp { public: IE_Imp_MSWrite(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/mswrite/xp/Makefile 2008-04-06 22:36:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/mswrite/xp/Makefile 2008-07-13 13:05:31.000000000 +0100 @@ -25,6 +25,8 @@ CPPSRCS= ie_imp_MSWrite.cpp \ ie_impexp_MSWrite.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/nroff/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/nroff/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/nroff/GNUmakefile.in 2008-04-06 22:37:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/nroff/GNUmakefile.in 2008-07-13 14:10:21.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/nroff/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/nroff/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/nroff/Makefile 2008-04-06 22:37:09.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/nroff/Makefile 2008-07-13 13:05:48.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_exp_Nroff.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/nroff/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/nroff/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/nroff/xp/GNUmakefile.in 2008-04-06 22:37:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/nroff/xp/GNUmakefile.in 2008-07-13 14:10:21.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/nroff/xp/ie_exp_Nroff.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/nroff/xp/ie_exp_Nroff.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/nroff/xp/ie_exp_Nroff.cpp 2008-04-06 22:37:09.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/nroff/xp/ie_exp_Nroff.cpp 2008-07-13 13:05:47.000000000 +0100 @@ -197,7 +197,7 @@ /* Exporter class */ /*********************************/ -class ABI_EXPORT IE_Exp_Nroff : public IE_Exp +class IE_Exp_Nroff : public IE_Exp { public: @@ -227,7 +227,7 @@ /* Export sniffer */ /*********************************/ -class ABI_EXPORT IE_Exp_Nroff_Sniffer +class IE_Exp_Nroff_Sniffer : public IE_ExpSniffer { friend class IE_Exp; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/nroff/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/nroff/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/nroff/xp/Makefile 2008-04-06 22:37:09.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/nroff/xp/Makefile 2008-07-13 13:05:47.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_exp_Nroff.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/GNUmakefile.in 2008-04-06 22:37:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/GNUmakefile.in 2008-07-13 14:10:11.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/Makefile 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/Makefile 2008-07-13 13:05:42.000000000 +0100 @@ -23,4 +23,6 @@ DIRS= xp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/xp/GNUmakefile.in 2008-04-06 22:37:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/xp/GNUmakefile.in 2008-07-13 14:10:11.000000000 +0100 @@ -79,6 +79,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/xp/ie_impexp_OpenDocument.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/xp/ie_impexp_OpenDocument.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/xp/ie_impexp_OpenDocument.cpp 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/xp/ie_impexp_OpenDocument.cpp 2008-07-13 13:05:42.000000000 +0100 @@ -100,8 +100,8 @@ /** * */ -ABI_FAR_CALL int abi_plugin_supports_version (UT_uint32 major, UT_uint32 minor, - UT_uint32 release) +ABI_FAR_CALL int abi_plugin_supports_version (UT_uint32 /*major*/, UT_uint32 /*minor*/, + UT_uint32 /*release*/) { return 1; } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/common/xp/Makefile 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/common/xp/Makefile 2008-07-13 13:05:42.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_impexp_OpenDocument.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= $(shell pkg-config --cflags libgsf-1) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/GNUmakefile.in 2008-04-06 22:37:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/GNUmakefile.in 2008-07-13 14:10:11.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/Makefile 2008-04-06 22:37:07.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/Makefile 2008-07-13 13:05:44.000000000 +0100 @@ -23,4 +23,6 @@ DIRS= xp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/GNUmakefile.in 2008-04-06 22:37:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/GNUmakefile.in 2008-07-13 14:10:12.000000000 +0100 @@ -98,6 +98,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ie_exp_OpenDocument.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ie_exp_OpenDocument.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ie_exp_OpenDocument.h 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ie_exp_OpenDocument.h 2008-07-13 13:05:43.000000000 +0100 @@ -33,7 +33,7 @@ // AbiWord includes #include -class ABI_EXPORT IE_Exp_OpenDocument : public IE_Exp +class IE_Exp_OpenDocument : public IE_Exp { public: IE_Exp_OpenDocument(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ie_exp_OpenDocument_Sniffer.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ie_exp_OpenDocument_Sniffer.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ie_exp_OpenDocument_Sniffer.h 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ie_exp_OpenDocument_Sniffer.h 2008-07-13 13:05:44.000000000 +0100 @@ -30,7 +30,7 @@ #include -class ABI_EXPORT IE_Exp_OpenDocument_Sniffer : public IE_ExpSniffer +class IE_Exp_OpenDocument_Sniffer : public IE_ExpSniffer { public: IE_Exp_OpenDocument_Sniffer(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/Makefile 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/Makefile 2008-07-13 13:05:44.000000000 +0100 @@ -48,6 +48,8 @@ ie_exp_OpenDocument.cpp \ ie_exp_OpenDocument_Sniffer.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= $(shell pkg-config --cflags libgsf-1) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListener.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListener.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListener.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListener.cpp 2008-07-13 13:05:44.000000000 +0100 @@ -80,7 +80,7 @@ /** * */ -bool ODe_AbiDocListener::populate(PL_StruxFmtHandle sfh, +bool ODe_AbiDocListener::populate(PL_StruxFmtHandle /*sfh*/, const PX_ChangeRecord * pcr) { switch (pcr->getType()) { @@ -208,7 +208,7 @@ /** * */ -bool ODe_AbiDocListener::populateStrux(PL_StruxDocHandle sdh, +bool ODe_AbiDocListener::populateStrux(PL_StruxDocHandle /*sdh*/, const PX_ChangeRecord* pcr, PL_StruxFmtHandle* psfh) { @@ -414,7 +414,7 @@ /** * */ -bool ODe_AbiDocListener::change(PL_StruxFmtHandle sfh, const PX_ChangeRecord * pcr) +bool ODe_AbiDocListener::change(PL_StruxFmtHandle /*sfh*/, const PX_ChangeRecord * /*pcr*/) { UT_ASSERT_NOT_REACHED(); return true; @@ -424,13 +424,13 @@ /** * */ -bool ODe_AbiDocListener::insertStrux(PL_StruxFmtHandle sfh, - const PX_ChangeRecord * pcr, - PL_StruxDocHandle sdh, - PL_ListenerId lid, - void (* pfnBindHandles)(PL_StruxDocHandle sdhNew, - PL_ListenerId lid, - PL_StruxFmtHandle sfhNew)) +bool ODe_AbiDocListener::insertStrux(PL_StruxFmtHandle /*sfh*/, + const PX_ChangeRecord * /*pcr*/, + PL_StruxDocHandle /*sdh*/, + PL_ListenerId /*lid*/, + void (* /*pfnBindHandles*/)(PL_StruxDocHandle sdhNew, + PL_ListenerId lid, + PL_StruxFmtHandle sfhNew)) { UT_ASSERT_NOT_REACHED(); return true; @@ -440,7 +440,7 @@ /** * */ -bool ODe_AbiDocListener::signal(UT_uint32 iSignal) +bool ODe_AbiDocListener::signal(UT_uint32 /*iSignal*/) { UT_ASSERT_NOT_REACHED(); return true; @@ -1168,7 +1168,7 @@ return; } - for (int i = 0; i < buf.length(); i++) { + for (UT_uint32 i = 0; i < buf.length(); i++) { if (buf[i] == '<') { if (((i + 1) < buf.length()) && (buf[i+1] == '/')) { output += "insertTabChar(); + sBuf += ""; p++; break; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListener.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListener.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListener.h 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListener.h 2008-07-13 13:05:43.000000000 +0100 @@ -158,7 +158,11 @@ m_pListenerImpl = pListenerImpl; } // Work around the "return 0" issue of the UT_GenericVector::getNhItem() - StackCell(UT_uint32 i) {m_pListenerImpl=NULL; m_deleteWhenPop=false;} + StackCell(UT_uint32 /*i*/) + { + m_pListenerImpl=NULL; + m_deleteWhenPop=false; + } StackCell& operator=(const StackCell& sc) { this->m_deleteWhenPop = sc.m_deleteWhenPop; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListenerImpl.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListenerImpl.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListenerImpl.h 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_AbiDocListenerImpl.h 2008-07-13 13:05:43.000000000 +0100 @@ -46,52 +46,52 @@ virtual ~ODe_AbiDocListenerImpl() {} - virtual void insertText(const UT_UTF8String& rText) {} + virtual void insertText(const UT_UTF8String& /*rText*/) {} virtual void insertLineBreak() {} virtual void insertColumnBreak() {} virtual void insertPageBreak() {} virtual void insertTabChar() {} - virtual void openSpan(const PP_AttrProp* pAP) {} + virtual void openSpan(const PP_AttrProp* /*pAP*/) {} virtual void closeSpan() {} - virtual void openBlock(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) {} + virtual void openBlock(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& /*rAction*/) {} virtual void closeBlock() {} - virtual void openSection(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) {} - virtual void closeSection(ODe_ListenerAction& rAction) {} + virtual void openSection(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& /*rAction*/) {} + virtual void closeSection(ODe_ListenerAction& /*rAction*/) {} - virtual void openField(const fd_Field* field, const UT_UTF8String& fieldType, const UT_UTF8String& fieldValue) {} - virtual void closeField(const UT_UTF8String& fieldType) {} + virtual void openField(const fd_Field* /*field*/, const UT_UTF8String& /*fieldType*/, const UT_UTF8String& /*fieldValue*/) {} + virtual void closeField(const UT_UTF8String& /*fieldType*/) {} - virtual void openTable(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) {} - virtual void closeTable(ODe_ListenerAction& rAction) {} + virtual void openTable(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& /*rAction*/) {} + virtual void closeTable(ODe_ListenerAction& /*rAction*/) {} - virtual void openCell(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) {} - virtual void closeCell(ODe_ListenerAction& rAction) {} + virtual void openCell(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& /*rAction*/) {} + virtual void closeCell(ODe_ListenerAction& /*rAction*/) {} - virtual void openFootnote(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) {} - virtual void closeFootnote(ODe_ListenerAction& rAction) {} + virtual void openFootnote(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& /*rAction*/) {} + virtual void closeFootnote(ODe_ListenerAction& /*rAction*/) {} - virtual void openEndnote(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) {} - virtual void closeEndnote(ODe_ListenerAction& rAction) {} + virtual void openEndnote(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& /*rAction*/) {} + virtual void closeEndnote(ODe_ListenerAction& /*rAction*/) {} - virtual void openFrame(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) {} - virtual void closeFrame(ODe_ListenerAction& rAction) {} + virtual void openFrame(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& /*rAction*/) {} + virtual void closeFrame(ODe_ListenerAction& /*rAction*/) {} - virtual void openTOC(const PP_AttrProp* pAP) {} + virtual void openTOC(const PP_AttrProp* /*pAP*/) {} virtual void closeTOC() {} - virtual void openBookmark(const PP_AttrProp* pAP) {} - virtual void closeBookmark(const PP_AttrProp* pAP) {} - virtual void closeBookmark(UT_UTF8String &sBookmarkName) {} + virtual void openBookmark(const PP_AttrProp* /*pAP*/) {} + virtual void closeBookmark(const PP_AttrProp* /*pAP*/) {} + virtual void closeBookmark(UT_UTF8String & /*sBookmarkName*/) {} - virtual void openHyperlink(const PP_AttrProp* pAP) {} + virtual void openHyperlink(const PP_AttrProp* /*pAP*/) {} virtual void closeHyperlink() {} - virtual void insertInlinedImage(const gchar* pImageName, - const PP_AttrProp* pAP) {} + virtual void insertInlinedImage(const gchar* /*pImageName*/, + const PP_AttrProp* /*pAP*/) {} protected: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Frame_Listener.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Frame_Listener.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Frame_Listener.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Frame_Listener.cpp 2008-07-13 13:05:44.000000000 +0100 @@ -58,11 +58,10 @@ */ void ODe_Frame_Listener::openFrame(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) { - bool ok; - const gchar* pValue; + bool ok = false; + const gchar* pValue = NULL; ok = pAP->getProperty("frame-type", pValue); - UT_ASSERT_HARMLESS(ok && pValue != NULL); if (pValue && !strcmp(pValue, "textbox")) { _openODTextbox(*pAP, rAction); @@ -93,7 +92,7 @@ /** * */ -void ODe_Frame_Listener::openTable(const PP_AttrProp* pAP, +void ODe_Frame_Listener::openTable(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& rAction) { ODe_Text_Listener* pTextListener; pTextListener = new ODe_Text_Listener(m_rAutomatiStyles, @@ -108,7 +107,7 @@ /** * */ -void ODe_Frame_Listener::openBlock(const PP_AttrProp* pAP, +void ODe_Frame_Listener::openBlock(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& rAction) { ODe_Text_Listener* pTextListener; pTextListener = new ODe_Text_Listener(m_rAutomatiStyles, @@ -124,11 +123,12 @@ * */ void ODe_Frame_Listener::_openODTextbox(const PP_AttrProp& rAP, - ODe_ListenerAction& rAction) { + ODe_ListenerAction& /*rAction*/) +{ UT_UTF8String output; UT_UTF8String str; bool ok; - const gchar* pValue; + const gchar* pValue = NULL; ODe_Style_Style* pStyle; pStyle = new ODe_Style_Style(); @@ -162,7 +162,6 @@ ok = rAP.getProperty("position-to", pValue); - UT_ASSERT (ok && pValue != NULL); if (pValue && !strcmp(pValue, "block-above-text")) { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ListenerAction.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ListenerAction.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ListenerAction.h 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ListenerAction.h 2008-07-13 13:05:44.000000000 +0100 @@ -42,10 +42,10 @@ ACTION_POP = 2 }; - void pushListenerImpl(ODe_AbiDocListenerImpl* pListenerImpl, bool deleteWhenPop) { + void pushListenerImpl(ODe_AbiDocListenerImpl* pListenerImpl, bool _deleteWhenPop) { m_action = ACTION_PUSH; m_pListenerImpl = pListenerImpl; - m_deleteWhenPop = deleteWhenPop; + m_deleteWhenPop = _deleteWhenPop; } void popListenerImpl() { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ListLevelStyle.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ListLevelStyle.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ListLevelStyle.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ListLevelStyle.cpp 2008-07-13 13:05:43.000000000 +0100 @@ -135,18 +135,17 @@ // We first load the common attributes. ODe_ListLevelStyle::fetchAttributesFromAbiBlock(rAP); - const gchar* pValue; - bool ok; - UT_UCS4Char ucs4Char; + const gchar* pValue = NULL; + bool ok = false; + UT_UCS4Char ucs4Char = 0; // I'm hardcoding this font because it has all possible bullet characters and // it's a free font. m_fontName = "FreeSerif"; ok = rAP.getProperty("list-style", pValue); - UT_ASSERT(ok && pValue != NULL); - if (!strcmp(pValue, "Bullet List")) { + if (!pValue || !strcmp(pValue, "Bullet List")) { ucs4Char = 8226; // U+2022 BULLET } else if (!strcmp(pValue, "Dashed List")) { ucs4Char = 8211; // U+2013 EN DASH @@ -221,13 +220,12 @@ // We first load the common attributes. ODe_ListLevelStyle::fetchAttributesFromAbiBlock(rAP); - const gchar* pValue; - bool ok; + const gchar* pValue = NULL; + bool ok = false; ok = rAP.getProperty("list-style", pValue); - UT_ASSERT(ok && pValue != NULL); - if (!strcmp(pValue, "Numbered List")) { + if (!pValue || !strcmp(pValue, "Numbered List")) { m_numFormat = "1"; } else if (!strcmp(pValue, "Lower Case List")) { m_numFormat = "a"; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Main_Listener.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Main_Listener.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Main_Listener.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Main_Listener.cpp 2008-07-13 13:05:43.000000000 +0100 @@ -176,7 +176,8 @@ /** * Override of ODe_AbiDocListenerImpl::closeSection */ -void ODe_Main_Listener::closeSection(ODe_ListenerAction& rAction) { +void ODe_Main_Listener::closeSection(ODe_ListenerAction& /*rAction*/) +{ if (m_openedODSection) { ODe_writeToFile(m_rDocumentData.m_pOfficeTextTemp, " \n"); @@ -213,12 +214,12 @@ const PP_AttrProp* pAP, ODe_ListenerAction& rAction) { const gchar* pValue; - const gchar* pId; + const gchar* pId = NULL; bool ok; UT_GenericVector* pMasterPageVector; UT_uint32 count, i; const ODe_Style_MasterPage* pMPageStyle; - GsfOutput* pTextOutput; + GsfOutput* pTextOutput = NULL; pMasterPageVector = m_rDocumentData.m_masterStyles.enumerate(); count = pMasterPageVector->getItemCount(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ManifestWriter.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ManifestWriter.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ManifestWriter.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_ManifestWriter.cpp 2008-07-13 13:05:43.000000000 +0100 @@ -70,6 +70,7 @@ const char* szName; const char* szMimeType; + const char **pszMimeType = &szMimeType; const UT_ByteBuf* pByteBuf; bool wroteDirManifest = false; @@ -78,7 +79,7 @@ NULL, &szName, &pByteBuf, - reinterpret_cast(const_cast(&szMimeType)))); k++) { + reinterpret_cast(pszMimeType))); k++) { if (szMimeType && !strcmp(szMimeType, "image/png")) { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_MetaDataWriter.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_MetaDataWriter.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_MetaDataWriter.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_MetaDataWriter.cpp 2008-07-13 13:05:43.000000000 +0100 @@ -86,7 +86,7 @@ UT_UTF8String buf = ""; UT_UCS4String keyword = keywords.utf8_str(); - for(int i = 0;i < keyword.length(); i++) + for(UT_uint32 i = 0;i < keyword.length(); i++) { if(keyword[i] != ' ') { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Note_Listener.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Note_Listener.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Note_Listener.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Note_Listener.cpp 2008-07-13 13:05:43.000000000 +0100 @@ -54,13 +54,13 @@ void ODe_Note_Listener::openFootnote(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) { bool ok; - const gchar* pValue; + const gchar* pValue = NULL; UT_UTF8String str; ok = pAP->getAttribute("footnote-id", pValue); - UT_ASSERT(ok && pValue != NULL); - - _openNote("footnote", pValue, rAction); + + if (ok && pValue) + _openNote("footnote", pValue, rAction); } @@ -78,13 +78,13 @@ void ODe_Note_Listener::openEndnote(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) { bool ok; - const gchar* pValue; + const gchar* pValue = NULL; UT_UTF8String str; ok = pAP->getAttribute("endnote-id", pValue); - UT_ASSERT(ok && pValue != NULL); - - _openNote("endnote", pValue, rAction); + + if (ok && pValue) + _openNote("endnote", pValue, rAction); } @@ -99,7 +99,7 @@ /** * */ -void ODe_Note_Listener::openBlock(const PP_AttrProp* pAP, +void ODe_Note_Listener::openBlock(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& rAction) { ODe_Text_Listener* pTextListener; pTextListener = new ODe_Text_Listener(m_rAutomatiStyles, @@ -116,10 +116,12 @@ */ void ODe_Note_Listener::_openNote(const gchar* pNoteClass, const gchar* pNoteId, - ODe_ListenerAction& rAction) { + ODe_ListenerAction& /*rAction*/) { UT_uint32 noteCitation; UT_UTF8String str; UT_UTF8String output; + + UT_return_if_fail(pNoteId); // The note citation will be id+1 // So id=0 will have a citation "1", and so on. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_PicturesWriter.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_PicturesWriter.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_PicturesWriter.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_PicturesWriter.cpp 2008-07-13 13:05:43.000000000 +0100 @@ -40,6 +40,7 @@ bool ODe_PicturesWriter::writePictures(PD_Document* pDoc, GsfOutfile* pODT) { const char * szName; const char * szMimeType; + const char ** pszMimeType = &szMimeType; const UT_ByteBuf * pByteBuf; GsfOutput* pImg; UT_UTF8String name; @@ -50,8 +51,7 @@ NULL, &szName, &pByteBuf, - reinterpret_cast - (const_cast(&szMimeType)))); + reinterpret_cast(pszMimeType))); k++) { if (szMimeType && !strcmp(szMimeType, "image/png")) { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_SettingsWriter.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_SettingsWriter.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_SettingsWriter.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_SettingsWriter.cpp 2008-07-13 13:05:43.000000000 +0100 @@ -32,7 +32,7 @@ #include -bool ODe_SettingsWriter::writeSettings(PD_Document* pDoc, GsfOutfile* oo) +bool ODe_SettingsWriter::writeSettings(PD_Document* /*pDoc*/, GsfOutfile* oo) { GsfOutput* pSettings = gsf_outfile_new_child (oo, "settings.xml", FALSE); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Style_PageLayout.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Style_PageLayout.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Style_PageLayout.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Style_PageLayout.cpp 2008-07-13 13:05:44.000000000 +0100 @@ -85,8 +85,8 @@ bool ok; bool hasAbiHeaderMargin = false; bool hasAbiFooterMargin = false; - double abiHeaderMarginCM; - double abiFooterMarginCM; + double abiHeaderMarginCM = 0.0; + double abiFooterMarginCM = 0.0; double abiTopMarginCM; double abiBottomMarginCM; UT_LocaleTransactor t(LC_NUMERIC, "C"); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Style_Style.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Style_Style.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Style_Style.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Style_Style.cpp 2008-07-13 13:05:43.000000000 +0100 @@ -1125,44 +1125,12 @@ ok = rAP.getProperty("text-decoration", pValue); if (ok && pValue != NULL) { - gchar buffer[500]; - UT_uint32 i,j; - bool keepGoing = true; - bool finishedWord = false; - - buffer[0] = 0; - i = 0; - - j = 0; - while (keepGoing) { - buffer[i] = pValue[j]; - - if (pValue[j] == 0) { - keepGoing = false; - finishedWord = true; - } else if (isspace(pValue[j])) { - finishedWord = true; - buffer[i] = 0; // Make a null terminated string - } - - if (finishedWord) { - if (!strcmp(buffer, "underline")) { - m_underlineType = "single"; - - } else if (!strcmp(buffer, "line-through")) { - m_lineThroughType = "single"; - } - finishedWord = false; - i = 0; - buffer[0] = 0; - } else { - i++; - } - - j++; - } - - } // if (ok) + if (strstr(pValue, "underline")) + m_underlineType = "single"; + + if (strstr(pValue, "line-through")) + m_lineThroughType = "single"; + } ok = rAP.getProperty("text-position", pValue); @@ -1389,34 +1357,26 @@ ok = rAP.getProperty("table-column-props", pValue); if (ok && pValue != NULL) { - gchar buffer[100]; - UT_uint32 i; + std::string buffer; double tableWidth = 0.0; - UT_Dimension dimension; + UT_Dimension dimension = DIM_none; bool gotDimension = false; // The table width is the sum of all column widths. - buffer[0] = 0; - i = 0; while (*pValue != 0) { if (*pValue == '/') { // We've reached the end of a column width - - buffer[i] = 0; // NULL terminate the string - if (!gotDimension) { - dimension = UT_determineDimension(buffer, DIM_none); + dimension = UT_determineDimension(buffer.c_str(), DIM_none); gotDimension = true; } - tableWidth += UT_convertDimensionless(buffer); - - i = 0; // Restart the buffer + tableWidth += UT_convertDimensionless(buffer.c_str()); + buffer.clear(); } else { // Store the character in the buffer - buffer[i] = *pValue; - i++; + buffer += *pValue; } pValue++; } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Table_Listener.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Table_Listener.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Table_Listener.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Table_Listener.cpp 2008-07-13 13:05:43.000000000 +0100 @@ -73,13 +73,13 @@ * */ void ODe_Table_Listener::openTable(const PP_AttrProp* pAP, - ODe_ListenerAction& rAction) { + ODe_ListenerAction& /*rAction*/) { const gchar* pValue; bool ok; - gchar buffer[100]; const gchar* pVar; UT_uint32 i; ODe_Style_Style* pStyle; + std::string buffer; UT_UTF8String styleName; UT_GenericVector columnStyleNames; UT_GenericVector rowStyleNames; @@ -116,63 +116,56 @@ ok = pAP->getProperty("table-column-props", pValue); if (ok && pValue != NULL) { pVar = pValue; - i=0; while (*pVar != 0) { if (*pVar == '/') { - buffer[i] = 0; // NULL-terminate the string - - if (buffer[0] != 0 /* or i > 0 */) { + if (!buffer.empty()) { UT_UTF8String_sprintf(styleName, "%s.col%u", m_tableName.utf8_str(), m_numColumns+1); pStyle = m_rAutomatiStyles.addTableColumnStyle(styleName); - pStyle->setColumnWidth(buffer); + pStyle->setColumnWidth(buffer.c_str()); columnStyleNames.addItem(new UT_UTF8String(styleName)); - i=0; // Clear the buffer. + buffer.clear(); } else { columnStyleNames.addItem(new UT_UTF8String("")); } m_numColumns++; } else { - buffer[i] = *pVar; - i++; + buffer += *pVar; } pVar++; } } + buffer.clear(); m_numRows = 0; ok = pAP->getProperty("table-row-heights", pValue); if (ok && pValue != NULL) { pVar = pValue; - i=0; while (*pVar != 0) { if (*pVar == '/') { - buffer[i] = 0; // NULL-terminate the string - - if (buffer[0] != 0 /* or i > 0 */) { + if (!buffer.empty()) { UT_UTF8String_sprintf(styleName, "%s.row%u", m_tableName.utf8_str(), m_numRows+1); pStyle = m_rAutomatiStyles.addTableRowStyle(styleName); - pStyle->setRowHeight(buffer); + pStyle->setRowHeight(buffer.c_str()); rowStyleNames.addItem(new UT_UTF8String(styleName)); - i=0; // Clear the buffer. + buffer.clear(); // Clear the buffer. } else { rowStyleNames.addItem(new UT_UTF8String("")); } m_numRows++; } else { - buffer[i] = *pVar; - i++; + buffer += *pVar; } pVar++; } @@ -389,10 +382,6 @@ m_bottomAttach = atoi(pValue); // A few sanity checks - UT_ASSERT(m_leftAttach >= 0); - UT_ASSERT(m_rightAttach >= 0); - UT_ASSERT(m_topAttach >= 0); - UT_ASSERT(m_bottomAttach >= 0); UT_ASSERT(m_leftAttach < m_rightAttach); UT_ASSERT(m_topAttach < m_bottomAttach); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Text_Listener.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Text_Listener.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Text_Listener.cpp 2008-04-06 22:37:06.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Text_Listener.cpp 2008-07-13 13:05:44.000000000 +0100 @@ -126,7 +126,7 @@ /** * */ -void ODe_Text_Listener::openTable(const PP_AttrProp* pAP, +void ODe_Text_Listener::openTable(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& rAction) { _closeODParagraph(); _closeODList(); @@ -144,7 +144,7 @@ * Override of ODe_AbiDocListenerImpl::openBlock */ void ODe_Text_Listener::openBlock(const PP_AttrProp* pAP, - ODe_ListenerAction& rAction) { + ODe_ListenerAction& /*rAction*/) { _closeODParagraph(); @@ -228,11 +228,10 @@ */ void ODe_Text_Listener::openFrame(const PP_AttrProp* pAP, ODe_ListenerAction& rAction) { - bool ok; - const gchar* pValue; + bool ok = false; + const gchar* pValue = NULL; ok = pAP->getProperty("frame-type", pValue); - UT_ASSERT_HARMLESS(ok && pValue != NULL); if (pValue && !strcmp(pValue, "textbox")) { ODe_Frame_Listener* pFrameListener; @@ -365,7 +364,7 @@ */ -void ODe_Text_Listener::openFootnote(const PP_AttrProp* pAP, +void ODe_Text_Listener::openFootnote(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& rAction) { ODe_Note_Listener* pNoteListener; @@ -389,6 +388,7 @@ } else { // We were inside a footnote. _closeODParagraph(); + _closeODList(); rAction.popListenerImpl(); } } @@ -397,7 +397,7 @@ /** * */ -void ODe_Text_Listener::openEndnote(const PP_AttrProp* pAP, +void ODe_Text_Listener::openEndnote(const PP_AttrProp* /*pAP*/, ODe_ListenerAction& rAction) { ODe_Note_Listener* pNoteListener; @@ -421,6 +421,7 @@ } else { // We were inside an endnote. _closeODParagraph(); + _closeODList(); rAction.popListenerImpl(); } } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/GNUmakefile.in 2008-04-06 22:37:48.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/GNUmakefile.in 2008-07-13 14:10:11.000000000 +0100 @@ -98,6 +98,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/GNUmakefile.in 2008-04-06 22:37:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/GNUmakefile.in 2008-07-13 14:10:12.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/Makefile 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/Makefile 2008-07-13 13:05:42.000000000 +0100 @@ -23,4 +23,6 @@ DIRS= xp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/GNUmakefile.in 2008-04-06 22:37:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/GNUmakefile.in 2008-07-13 14:10:12.000000000 +0100 @@ -101,6 +101,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ie_imp_OpenDocument.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ie_imp_OpenDocument.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ie_imp_OpenDocument.h 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ie_imp_OpenDocument.h 2008-07-13 13:05:42.000000000 +0100 @@ -43,7 +43,7 @@ /** * Class used to import OpenDocument files */ -class ABI_EXPORT IE_Imp_OpenDocument : public IE_Imp +class IE_Imp_OpenDocument : public IE_Imp { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ie_imp_OpenDocument_Sniffer.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ie_imp_OpenDocument_Sniffer.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ie_imp_OpenDocument_Sniffer.h 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ie_imp_OpenDocument_Sniffer.h 2008-07-13 13:05:41.000000000 +0100 @@ -28,7 +28,7 @@ #include -class ABI_EXPORT IE_Imp_OpenDocument_Sniffer : public IE_ImpSniffer +class IE_Imp_OpenDocument_Sniffer : public IE_ImpSniffer { public: IE_Imp_OpenDocument_Sniffer () ; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/Makefile 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/Makefile 2008-07-13 13:05:41.000000000 +0100 @@ -49,6 +49,8 @@ ODi_TextContent_ListenerState.cpp \ ODi_XMLRecorder.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= $(shell pkg-config --cflags libgsf-1) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ContentStream_ListenerState.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ContentStream_ListenerState.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ContentStream_ListenerState.cpp 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ContentStream_ListenerState.cpp 2008-07-13 13:05:42.000000000 +0100 @@ -122,7 +122,7 @@ /** * */ -void ODi_ContentStream_ListenerState::charData ( - const gchar* pBuffer, int length) +void ODi_ContentStream_ListenerState::charData (const gchar* /*pBuffer*/, + int /*length*/) { } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ElementStack.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ElementStack.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ElementStack.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ElementStack.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -56,7 +56,7 @@ void ODi_ElementStack::startElement (const gchar* pName, const gchar** ppAtts) { - ODi_StartTag* pStartTag; + ODi_StartTag* pStartTag = NULL; if (!m_pStartTags) { m_pStartTags = new UT_GenericVector (10, 10); @@ -85,7 +85,7 @@ * Must be the last command called by the endElement method of the listener * class. */ -void ODi_ElementStack::endElement (const gchar* pName) { +void ODi_ElementStack::endElement (const gchar* /*pName*/) { UT_ASSERT(m_pStartTags != NULL); UT_return_if_fail(m_stackSize > 0); m_stackSize--; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_FontFaceDecls.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_FontFaceDecls.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_FontFaceDecls.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_FontFaceDecls.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -43,8 +43,8 @@ */ void ODi_FontFaceDecls::startElement (const gchar* pName, const gchar** ppAtts, - ODi_ListenerStateAction& rAction) { - + ODi_ListenerStateAction& /*rAction*/) +{ if (!strcmp(pName, "style:font-face")) { const gchar* pStyleName; const gchar* pFontFamily; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_FontFaceDecls.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_FontFaceDecls.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_FontFaceDecls.h 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_FontFaceDecls.h 2008-07-13 13:05:41.000000000 +0100 @@ -47,7 +47,7 @@ void endElement (const gchar* pName, ODi_ListenerStateAction& rAction); - void charData (const gchar* pBuffer, int length) {} + void charData (const gchar* /*pBuffer*/, int /*length*/) {} const std::string & getFontFamily(const UT_UTF8String& rStyleName); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Frame_ListenerState.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Frame_ListenerState.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Frame_ListenerState.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Frame_ListenerState.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -48,7 +48,9 @@ m_pStyles(pStyles), m_parsedFrameStartTag(false), m_inlinedImage(false), - m_iFrameDepth(0) + m_iFrameDepth(0), + m_pMathBB(NULL), + m_bInMath(false) { if (m_rElementStack.hasElement("office:document-content")) { m_bOnContentStream = true; @@ -65,6 +67,20 @@ const gchar** ppAtts, ODi_ListenerStateAction& rAction) { + UT_return_if_fail(pName); + + if(m_bInMath && m_pMathBB && (strcmp(pName, "math:math") != 0)) + { + if (strncmp(pName, "math:", 5) != 0) { + return; + } + + m_pMathBB->append(reinterpret_cast("<"), 1); + m_pMathBB->append(reinterpret_cast(pName + 5), strlen(pName) - 5); //build the mathml + m_pMathBB->append(reinterpret_cast(">"), 1); + return; + } + if (!strcmp(pName, "draw:frame")) { if (m_parsedFrameStartTag) { // It's a nested frame. @@ -86,6 +102,14 @@ } } else if (!strcmp(pName, "draw:object")) { _drawObject(ppAtts, rAction); + + } else if (!strcmp(pName, "math:math")) { + + DELETEP(m_pMathBB); + m_pMathBB = new UT_ByteBuf; + m_pMathBB->append(reinterpret_cast(""), 65); + + m_bInMath = true; } } @@ -96,6 +120,20 @@ void ODi_Frame_ListenerState::endElement (const gchar* pName, ODi_ListenerStateAction& rAction) { + UT_return_if_fail(pName); + + if(m_bInMath && m_pMathBB && (strcmp(pName, "math:math") != 0)) + { + if (strncmp(pName, "math:", 5) != 0) { + return; + } + + m_pMathBB->append(reinterpret_cast("append(reinterpret_cast(pName + 5), strlen(pName) - 5); //build the mathml + m_pMathBB->append(reinterpret_cast(">"), 1); + return; + } + if (!strcmp(pName, "draw:frame")) { if (!m_inlinedImage && (m_iFrameDepth > 0)) { @@ -108,6 +146,26 @@ // We're done. rAction.popState(); + } else if (!strcmp(pName, "math:math")) { + + if (m_pMathBB) { + + m_pMathBB->append(reinterpret_cast(""), 7); + + // Create the data item + UT_uint32 id = m_pAbiDocument->getUID(UT_UniqueId::Math); + UT_UTF8String sID = UT_UTF8String_sprintf("MathLatex%d", id); + m_pAbiDocument->createDataItem(sID.utf8_str(), false, m_pMathBB, NULL, NULL); + + const gchar *atts[3] = { NULL, NULL, NULL }; + atts[0] = PT_IMAGE_DATAID; + atts[1] = sID.utf8_str(); + m_pAbiDocument->appendObject(PTO_Math, atts); + + DELETEP(m_pMathBB); + } + + m_bInMath = false; } } @@ -115,8 +173,12 @@ /** * */ -void ODi_Frame_ListenerState::charData (const gchar* pBuffer, int length) { - // Nothing yet... +void ODi_Frame_ListenerState::charData (const gchar* pBuffer, int length) +{ + if (m_bInMath && m_pMathBB) { + m_pMathBB->append(reinterpret_cast(pBuffer), length); + return; + } } @@ -236,7 +298,7 @@ void ODi_Frame_ListenerState::_drawObject (const gchar** ppAtts, ODi_ListenerStateAction& rAction) { - const gchar* pChar; + const gchar* pChar = NULL; const ODi_Style_Style* pGraphicStyle; UT_String dataId; // id of the data item that contains the object. @@ -309,8 +371,6 @@ props = "frame-type:image"; if(!_getFrameProperties(props, ppAtts)) { - // Abort mission! - rAction.ignoreElement(); return; } @@ -449,7 +509,7 @@ const ODi_Style_Style* pGraphicStyle; const UT_UTF8String* pWrap; const UT_UTF8String* pBackgroundColor; - const gchar* pVal; + const gchar* pVal = NULL; pStyleName = m_rElementStack.getStartTag(0)->getAttributeValue("draw:style-name"); UT_ASSERT(pStyleName); @@ -487,7 +547,7 @@ pVal = m_rElementStack.getStartTag(0)->getAttributeValue("text:anchor-type"); - UT_ASSERT_HARMLESS(pVal); + if (pVal && !strcmp(pVal, "paragraph")) { rProps += "; position-to:block-above-text"; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Frame_ListenerState.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Frame_ListenerState.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Frame_ListenerState.h 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Frame_ListenerState.h 2008-07-13 13:05:41.000000000 +0100 @@ -86,6 +86,9 @@ // on the AbiWord document. bool m_inlinedImage; UT_sint32 m_iFrameDepth; + + UT_ByteBuf* m_pMathBB; + bool m_bInMath; }; #endif //_ODI_FRAME_LISTENERSTATE_H_ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -54,21 +54,25 @@ */ void ODi_ListLevelStyle::startElement (const gchar* pName, const gchar** ppAtts, - ODi_ListenerStateAction& rAction) { + ODi_ListenerStateAction& /*rAction*/) +{ const gchar* pVal = NULL; if (!strcmp("text:list-level-style-bullet", pName) || !strcmp("text:list-level-style-number", pName) || !strcmp("text:list-level-style-image", pName)) { - UT_uint32 result; + UT_uint32 result = 0; pVal = UT_getAttribute ("text:level", ppAtts); - UT_ASSERT(pVal); - result = sscanf(pVal, "%u", &m_levelNumber); - UT_ASSERT(result==1); - m_level = pVal; + if (pVal) { + result = sscanf(pVal, "%u", &m_levelNumber); + // TODO: check result? + m_level = pVal; + } else { + UT_DEBUGMSG(("ODi_ListLevelStyle::startElement: missing text:level attribute\n")); + } pVal = UT_getAttribute ("text:style-name", ppAtts); if (pVal) { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.h 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.h 2008-07-13 13:05:41.000000000 +0100 @@ -47,7 +47,7 @@ virtual void endElement (const gchar* pName, ODi_ListenerStateAction& rAction); - virtual void charData (const gchar* pBuffer, int length) {} + virtual void charData (const gchar* /*pBuffer*/, int /*length*/) {} UT_uint32 getLevelNumber() const {return m_levelNumber;} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ManifestStream_ListenerState.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ManifestStream_ListenerState.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ManifestStream_ListenerState.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ManifestStream_ListenerState.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -46,8 +46,8 @@ * Called to signal that the start tag of an element has been reached. */ void ODi_ManifestStream_ListenerState::startElement (const gchar* pName, - const gchar** ppAtts, - ODi_ListenerStateAction& rAction) + const gchar** /*ppAtts*/, + ODi_ListenerStateAction& /*rAction*/) { if (!strcmp(pName, "manifest:encryption-data")) { m_isDocumentEncripted = true; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ManifestStream_ListenerState.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ManifestStream_ListenerState.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ManifestStream_ListenerState.h 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ManifestStream_ListenerState.h 2008-07-13 13:05:42.000000000 +0100 @@ -45,7 +45,7 @@ void endElement (const gchar* pName, ODi_ListenerStateAction& rAction); - void charData (const gchar* pBuffer, int length) {} + void charData (const gchar* /*pBuffer*/, int /*length*/) {} bool isDocumentEncripted() const {return m_isDocumentEncripted;}; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_MetaStream_ListenerState.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_MetaStream_ListenerState.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_MetaStream_ListenerState.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_MetaStream_ListenerState.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -48,9 +48,9 @@ /** * Called to signal that the start tag of an element has been reached. */ -void ODi_MetaStream_ListenerState::startElement (const gchar* pName, - const gchar** ppAtts, - ODi_ListenerStateAction& rAction) +void ODi_MetaStream_ListenerState::startElement (const gchar* /*pName*/, + const gchar** /*ppAtts*/, + ODi_ListenerStateAction& /*rAction*/) { m_charData.clear (); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_NotesConfiguration.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_NotesConfiguration.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_NotesConfiguration.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_NotesConfiguration.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -33,8 +33,9 @@ * */ void ODi_NotesConfiguration::startElement(const gchar* pName, - const gchar** ppAtts, - ODi_ListenerStateAction& rAction) { + const gchar** ppAtts, + ODi_ListenerStateAction& /*rAction*/) +{ const gchar* pVal; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_NotesConfiguration.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_NotesConfiguration.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_NotesConfiguration.h 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_NotesConfiguration.h 2008-07-13 13:05:41.000000000 +0100 @@ -42,7 +42,7 @@ void endElement(const gchar* pName, ODi_ListenerStateAction& rAction); - void charData (const gchar* pBuffer, int length) {} + void charData (const gchar* /*pBuffer*/, int /*length*/) {} const UT_UTF8String* getCitationStyleName() const {return &m_citationStyleName;} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Office_Styles.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Office_Styles.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Office_Styles.cpp 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Office_Styles.cpp 2008-07-13 13:05:42.000000000 +0100 @@ -230,16 +230,15 @@ ODi_Style_Style* ODi_Office_Styles::addDefaultStyle(const gchar** ppAtts, ODi_ElementStack& rElementStack) { - const gchar* pAttr; + const gchar* pAttr = NULL; pAttr = UT_getAttribute("style:family", ppAtts); - UT_ASSERT(pAttr); - if (!strcmp("paragraph", pAttr)) { + if (pAttr && !strcmp("paragraph", pAttr)) { return m_paragraphStyleStyles.addDefaultStyle(rElementStack); - } else if (!strcmp("table", pAttr)) { + } else if (pAttr && !strcmp("table", pAttr)) { return m_tableStyleStyles.addDefaultStyle(rElementStack); @@ -280,7 +279,7 @@ ODi_Style_PageLayout* pLayout; pMasterStylesVec = m_masterPageStyles.enumerate(); - UT_ASSERT(pMasterStylesVec); + UT_return_if_fail(pMasterStylesVec); count = pMasterStylesVec->getItemCount(); for (i=0; igetItemCount(); for (i=0; igetLevelCount(); @@ -349,7 +348,7 @@ pListVec = m_listStyles.enumerate(); - UT_ASSERT(pListVec); + UT_return_if_fail(pListVec); count = pListVec->getItemCount(); for (i=0; igetItemCount(); for (i=0; i= -1); - UT_ASSERT(m_pElementStack->getStackSize() - + UT_ASSERT((int)m_pElementStack->getStackSize() - (m_stateAction.getElementLevel()+1) >= 0); m_elemenStackSize = m_pElementStack->getStackSize() - diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_StreamListener.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_StreamListener.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_StreamListener.h 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_StreamListener.h 2008-07-13 13:05:41.000000000 +0100 @@ -126,7 +126,7 @@ m_pState = pState; } // Work around the "return 0" issue of the UT_GenericVector::getNhItem() - StackCell(UT_uint32 i) {m_pState=NULL; m_deleteWhenPop=false;} + StackCell(UT_uint32 /*i*/) {m_pState=NULL; m_deleteWhenPop=false;} StackCell& operator=(const StackCell& sc) { this->m_deleteWhenPop = sc.m_deleteWhenPop; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_List.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_List.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_List.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_List.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -88,7 +88,8 @@ /** * */ -void ODi_Style_List::charData (const gchar* pBuffer, int length) { +void ODi_Style_List::charData (const gchar* /*pBuffer*/, int /*length*/) +{ } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_MasterPage.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_MasterPage.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_MasterPage.h 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_MasterPage.h 2008-07-13 13:05:41.000000000 +0100 @@ -48,7 +48,7 @@ void endElement(const gchar* pName, ODi_ListenerStateAction& rAction); - void charData (const gchar* pBuffer, int length) {} + void charData (const gchar* /*pBuffer*/, int /*length*/) {} inline const UT_UTF8String& getLayoutName() const {return m_layoutName;} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_PageLayout.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_PageLayout.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_PageLayout.cpp 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_PageLayout.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -40,7 +40,8 @@ */ void ODi_Style_PageLayout::startElement(const gchar* pName, const gchar** ppAtts, - ODi_ListenerStateAction& rAction) { + ODi_ListenerStateAction& /*rAction*/) +{ const gchar* pVal; @@ -121,8 +122,8 @@ UT_uint32 propCtr = 0; static const int MAX_PAGE_ATTS = 13; // 2*(width height orientation pagetype units page-scale) 0 const gchar* pageAtts[MAX_PAGE_ATTS]; - double pageWidthMmNumeric; - double pageHeightMmNumeric; + double pageWidthMmNumeric = 0.0; + double pageHeightMmNumeric = 0.0; UT_UTF8String pageWidthMm; UT_UTF8String pageHeightMm; UT_LocaleTransactor lt(LC_NUMERIC, "C"); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_PageLayout.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_PageLayout.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_PageLayout.h 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_PageLayout.h 2008-07-13 13:05:41.000000000 +0100 @@ -52,7 +52,7 @@ void endElement(const gchar* pName, ODi_ListenerStateAction& rAction); - void charData (const gchar* pBuffer, int length) {} + void charData (const gchar* /*pBuffer*/, int /*length*/) {} void definePageSizeTag(PD_Document* pDocument) const; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_StylesStream_ListenerState.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_StylesStream_ListenerState.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_StylesStream_ListenerState.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_StylesStream_ListenerState.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -153,7 +153,7 @@ * e.g: char_data */ void ODi_StylesStream_ListenerState::charData ( - const gchar* pBuffer, int length) + const gchar* /*pBuffer*/, int /*length*/) { } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -64,7 +64,8 @@ */ void ODi_Style_Style::startElement(const gchar* pName, const gchar** ppAtts, - ODi_ListenerStateAction& rAction) { + ODi_ListenerStateAction& /*rAction*/) +{ if (!strcmp("style:style", pName)) { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style_Family.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style_Family.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style_Family.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style_Family.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -155,7 +155,7 @@ UT_uint32 i, count; UT_GenericVector* pStylesVec; - ODi_Style_Style* pStyle; + ODi_Style_Style* pStyle = NULL; bool noneFound; do { @@ -249,7 +249,6 @@ UT_GenericVector* pStylesVec; UT_UTF8String styleName; UT_UTF8String replacementName; - bool ok; _findSuitableReplacement(replacementName, pRemovedStyle, bOnContentStream); @@ -448,6 +447,9 @@ */ const ODi_Style_Style* ODi_Style_Style_Family::getStyle(const gchar* pStyleName, bool bOnContentStream) { + + UT_return_val_if_fail(pStyleName, NULL); + const ODi_Style_Style* pStyle = NULL; // Is it the default style? diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style.h 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Style_Style.h 2008-07-13 13:05:41.000000000 +0100 @@ -59,7 +59,7 @@ void endElement(const gchar* pName, ODi_ListenerStateAction& rAction); - void charData (const gchar* pBuffer, int length) {} + void charData (const gchar* /*pBuffer*/, int /*length*/) {} const UT_UTF8String& getDisplayName() const {return m_displayName;} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Table_ListenerState.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Table_ListenerState.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Table_ListenerState.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Table_ListenerState.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -255,7 +255,7 @@ * Used to parse a start element. */ void ODi_Table_ListenerState::_parseColumnStart (const gchar** ppAtts, - ODi_ListenerStateAction& rAction) + ODi_ListenerStateAction& /*rAction*/) { if (m_onFirstPass) { const gchar* pStyleName; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Table_ListenerState.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Table_ListenerState.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Table_ListenerState.h 2008-04-06 22:37:05.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_Table_ListenerState.h 2008-07-13 13:05:42.000000000 +0100 @@ -64,7 +64,7 @@ void endElement (const gchar* pName, ODi_ListenerStateAction& rAction); - void charData (const gchar* pBuffer, int length) {} + void charData (const gchar* /*pBuffer*/, int /*length*/) {} private: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_TableOfContent_ListenerState.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_TableOfContent_ListenerState.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_TableOfContent_ListenerState.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_TableOfContent_ListenerState.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -51,8 +51,9 @@ * */ void ODi_TableOfContent_ListenerState::startElement (const gchar* pName, - const gchar** ppAtts, - ODi_ListenerStateAction& rAction) { + const gchar** ppAtts, + ODi_ListenerStateAction& /*rAction*/) +{ if (!strcmp(pName, "text:index-title-template")) { const gchar* pVal; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_TextContent_ListenerState.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_TextContent_ListenerState.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_TextContent_ListenerState.cpp 2008-04-06 22:37:04.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_TextContent_ListenerState.cpp 2008-07-13 13:05:41.000000000 +0100 @@ -135,12 +135,9 @@ } else if (!strcmp(pName, "text:h" )) { - const gchar* pStyleName; - const gchar* pOutlineLevel; - const ODi_Style_Style* pStyle; - - pStyleName = UT_getAttribute("text:style-name", ppAtts); - UT_ASSERT(pStyleName); + const gchar* pStyleName = NULL; + const gchar* pOutlineLevel = NULL; + const ODi_Style_Style* pStyle = NULL; pOutlineLevel = UT_getAttribute("text:outline-level", ppAtts); if (pOutlineLevel == NULL) { @@ -148,9 +145,11 @@ // be at level 1. pOutlineLevel = "1"; } - - pStyle = m_pStyles->getParagraphStyle(pStyleName, m_bOnContentStream); - UT_ASSERT_HARMLESS(pStyle); + + pStyleName = UT_getAttribute("text:style-name", ppAtts); + if (pStyleName) { + pStyle = m_pStyles->getParagraphStyle(pStyleName, m_bOnContentStream); + } if (pStyle && (pStyle->isAutomatic())) { @@ -289,11 +288,11 @@ } else if (!strcmp(pName, "text:bookmark")) { _flush (); - const gchar * pName = UT_getAttribute ("text:name", ppAtts); + const gchar * pAttr = UT_getAttribute ("text:name", ppAtts); - if(pName) { - _insertBookmark (pName, "start"); - _insertBookmark (pName, "end"); + if(pAttr) { + _insertBookmark (pAttr, "start"); + _insertBookmark (pAttr, "end"); } else { UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); } @@ -301,10 +300,10 @@ } else if (!strcmp(pName, "text:bookmark-start")) { _flush (); - const gchar * pName = UT_getAttribute ("text:name", ppAtts); + const gchar * pAttr = UT_getAttribute ("text:name", ppAtts); - if(pName) { - _insertBookmark (pName, "start"); + if(pAttr) { + _insertBookmark (pAttr, "start"); } else { UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); } @@ -312,10 +311,10 @@ } else if (!strcmp(pName, "text:bookmark-end")) { _flush (); - const gchar * pName = UT_getAttribute ("text:name", ppAtts); + const gchar * pAttr = UT_getAttribute ("text:name", ppAtts); - if(pName) { - _insertBookmark (pName, "end"); + if(pAttr) { + _insertBookmark (pAttr, "end"); } else { UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); } @@ -449,9 +448,8 @@ const gchar* pVal; pVal = UT_getAttribute("text:anchor-type", ppAtts); - UT_ASSERT(pVal); - if (pVal && (!strcmp(pVal, "as-char") || !strcmp(pVal, "char"))) { + if (!pVal || !strcmp(pVal, "as-char") || !strcmp(pVal, "char")) { _flush(); rAction.pushState("Frame"); } else { @@ -493,14 +491,14 @@ } else if (!strcmp(pName, "text:note-body")) { - const gchar* ppAtts[10]; + const gchar* ppAtts2[10]; bool ok; UT_uint32 id; const ODi_NotesConfiguration* pNotesConfig; const ODi_Style_Style* pStyle = NULL; const UT_UTF8String* pCitationStyleName = NULL; UT_uint8 i; - bool isFootnote; + bool isFootnote = false; const gchar* pNoteClass; pNoteClass = m_rElementStack.getStartTag(0)->getAttributeValue("text:note-class"); @@ -534,38 +532,38 @@ } i = 0; - ppAtts[i++] = "type"; + ppAtts2[i++] = "type"; if (isFootnote) { - ppAtts[i++] = "footnote_ref"; - ppAtts[i++] = "footnote-id"; + ppAtts2[i++] = "footnote_ref"; + ppAtts2[i++] = "footnote-id"; } else { - ppAtts[i++] = "endnote_ref"; - ppAtts[i++] = "endnote-id"; + ppAtts2[i++] = "endnote_ref"; + ppAtts2[i++] = "endnote-id"; } - ppAtts[i++] = m_currentNoteId.utf8_str(); + ppAtts2[i++] = m_currentNoteId.utf8_str(); if (pCitationStyleName && (!pCitationStyleName->empty()) && (pStyle != NULL)) { - ppAtts[i++] = "style"; - ppAtts[i++] = pStyle->getDisplayName().utf8_str(); + ppAtts2[i++] = "style"; + ppAtts2[i++] = pStyle->getDisplayName().utf8_str(); } - ppAtts[i++] = "props"; - ppAtts[i++] = "text-position:superscript"; - ppAtts[i] = 0; + ppAtts2[i++] = "props"; + ppAtts2[i++] = "text-position:superscript"; + ppAtts2[i] = 0; - ok = m_pAbiDocument->appendObject(PTO_Field, ppAtts); + ok = m_pAbiDocument->appendObject(PTO_Field, ppAtts2); UT_ASSERT(ok); if (isFootnote) { - ppAtts[0] = "footnote-id"; + ppAtts2[0] = "footnote-id"; } else { - ppAtts[0] = "endnote-id"; + ppAtts2[0] = "endnote-id"; } - ppAtts[1] = m_currentNoteId.utf8_str(); - ppAtts[2] = 0; + ppAtts2[1] = m_currentNoteId.utf8_str(); + ppAtts2[2] = 0; if (isFootnote) { - ok = m_pAbiDocument->appendStrux(PTX_SectionFootnote, ppAtts); + ok = m_pAbiDocument->appendStrux(PTX_SectionFootnote, ppAtts2); } else { - ok = m_pAbiDocument->appendStrux(PTX_SectionEndnote, ppAtts); + ok = m_pAbiDocument->appendStrux(PTX_SectionEndnote, ppAtts2); } UT_ASSERT(ok); @@ -680,7 +678,7 @@ rAction.popState(); } else if (!strcmp(pName, "text:note-body")) { - bool ok; + bool ok = false; const gchar* pNoteClass; pNoteClass = m_rElementStack.getStartTag(1)->getAttributeValue("text:note-class"); @@ -792,7 +790,7 @@ if (!m_stackFmtStartIndex.pop(&start)) return; - UT_uint32 k; + UT_sint32 k; UT_uint32 end = m_vecInlineFmt.getItemCount(); const gchar* p; @@ -1005,9 +1003,10 @@ /** * Process and startElement calls */ -void ODi_TextContent_ListenerState::_startParagraphElement (const gchar* pName, +void ODi_TextContent_ListenerState::_startParagraphElement (const gchar* /*pName*/, const gchar** ppParagraphAtts, - ODi_ListenerStateAction& rAction) { + ODi_ListenerStateAction& /*rAction*/) +{ bool bIsListParagraph = false; const gchar* pStyleName; const gchar *ppAtts[50]; @@ -1027,7 +1026,10 @@ if (pStyleName) { pStyle = m_pStyles->getParagraphStyle(pStyleName, m_bOnContentStream); - UT_ASSERT(pStyle); + + if (!pStyle) { + pStyle = m_pStyles->getTextStyle(pStyleName, m_bOnContentStream); + } // Damn, use the default style if (!pStyle) { @@ -1242,8 +1244,9 @@ * */ void ODi_TextContent_ListenerState::_endParagraphElement ( - const gchar* pName, - ODi_ListenerStateAction& rAction) { + const gchar* /*pName*/, + ODi_ListenerStateAction& rAction) +{ const gchar* pStyleName; const ODi_Style_Style* pStyle; @@ -1257,7 +1260,10 @@ if (pStyleName) { pStyle = m_pStyles->getParagraphStyle(pStyleName, m_bOnContentStream); - UT_ASSERT(pStyle); + + if (!pStyle) { + pStyle = m_pStyles->getTextStyle(pStyleName, m_bOnContentStream); + } // Damn, use the default style if (!pStyle) { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/Makefile 2008-04-06 22:37:07.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenDocument/Makefile 2008-07-13 13:05:44.000000000 +0100 @@ -80,6 +80,8 @@ $(OBJDIR)/ODe_Table_Listener.$(OBJ_SUFFIX) \ $(OBJDIR)/ODe_Text_Listener.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/GNUmakefile.in 2008-04-06 22:37:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/GNUmakefile.in 2008-07-13 14:10:12.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/Makefile 2008-04-06 22:37:01.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/Makefile 2008-07-13 13:05:36.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_OpenWriter.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_exp_OpenWriter.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/xp/GNUmakefile.in 2008-04-06 22:37:49.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/xp/GNUmakefile.in 2008-07-13 14:10:12.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/xp/ie_exp_OpenWriter.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/xp/ie_exp_OpenWriter.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/xp/ie_exp_OpenWriter.h 2008-04-06 22:37:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/xp/ie_exp_OpenWriter.h 2008-07-13 13:05:36.000000000 +0100 @@ -41,7 +41,7 @@ #include -class ABI_EXPORT IE_Exp_OpenWriter : public IE_Exp +class IE_Exp_OpenWriter : public IE_Exp { public: IE_Exp_OpenWriter(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/xp/ie_impexp_OpenWriter.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/xp/ie_impexp_OpenWriter.h --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/xp/ie_impexp_OpenWriter.h 2008-04-06 22:37:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/xp/ie_impexp_OpenWriter.h 2008-07-13 13:05:36.000000000 +0100 @@ -25,7 +25,7 @@ #include "ie_imp.h" #include "ie_exp.h" -class ABI_EXPORT IE_Imp_OpenWriter_Sniffer : public IE_ImpSniffer +class IE_Imp_OpenWriter_Sniffer : public IE_ImpSniffer { public: IE_Imp_OpenWriter_Sniffer () ; @@ -46,7 +46,7 @@ IEFileType * ft) ; }; -class ABI_EXPORT IE_Exp_OpenWriter_Sniffer : public IE_ExpSniffer +class IE_Exp_OpenWriter_Sniffer : public IE_ExpSniffer { public: IE_Exp_OpenWriter_Sniffer(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/xp/ie_imp_OpenWriter.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/xp/ie_imp_OpenWriter.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenWriter/xp/ie_imp_OpenWriter.cpp 2008-04-06 22:37:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenWriter/xp/ie_imp_OpenWriter.cpp 2008-07-13 13:05:36.000000000 +0100 @@ -264,6 +264,7 @@ void parse (const gchar ** props) { const gchar * val = NULL; + const gchar * val2 = NULL; val = UT_getAttribute ("fo:text-align", props); if (val) @@ -324,10 +325,16 @@ else m_fontSize = UT_String_sprintf ("font-size: %s;", val); } - - if (UT_getAttribute("fo:language", props) && UT_getAttribute("fo:country", props)) - m_lang = UT_String_sprintf ("lang: %s-%s;", UT_getAttribute("fo:language", props), - UT_getAttribute("fo:country", props)); + + val = UT_getAttribute("fo:language", props); + val2 = UT_getAttribute("fo:country", props); + if (val && val2 && *val && *val2) { + if (!strcmp(val, "zxx") && !strcmp(val2, "none")) { + m_lang = "lang:-none-;"; // no proofing + } else { + m_lang = UT_String_sprintf ("lang:%s-%s;", val, val2); + } + } val = UT_getAttribute("style:text-position", props); if(val) { @@ -507,7 +514,7 @@ /*! * Class used to import OpenWriter documents */ -class ABI_EXPORT IE_Imp_OpenWriter : public IE_Imp +class IE_Imp_OpenWriter : public IE_Imp { public: IE_Imp_OpenWriter (PD_Document * pDocument); @@ -594,6 +601,31 @@ g_object_unref (G_OBJECT (pInput)); } + // there's no mimetype stream, so let's check for a content.xml file instead + else + { + pInput = gsf_infile_child_by_name(zip, "content.xml"); + + gsf_off_t size = 0; + if (pInput) + size = gsf_input_size(pInput); + + if (size > 0) + { + int min = UT_MIN(size, 150); + + UT_UTF8String content; + content.append((const char *)gsf_input_read(pInput, min, NULL)); + + if (strstr(content.utf8_str(), " -class ABI_EXPORT IE_Imp_OpenXML_Sniffer : public IE_ImpSniffer +class IE_Imp_OpenXML_Sniffer : public IE_ImpSniffer { public: IE_Imp_OpenXML_Sniffer () ; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenXML/imp/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenXML/imp/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenXML/imp/xp/Makefile 2008-04-06 22:36:55.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenXML/imp/xp/Makefile 2008-07-13 13:05:27.000000000 +0100 @@ -37,6 +37,8 @@ OXMLi_StreamListener.cpp \ OXMLi_PackageManager.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= -I$(shell pkg-config --cflags libgsf-1) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/OpenXML/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/OpenXML/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/OpenXML/Makefile 2008-04-06 22:36:55.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/OpenXML/Makefile 2008-07-13 13:05:28.000000000 +0100 @@ -49,6 +49,8 @@ $(OBJDIR)/OXMLi_ListenerState_Common.$(OBJ_SUFFIX) \ $(OBJDIR)/OXMLi_PackageManager.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/opml/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/opml/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/opml/GNUmakefile.in 2008-04-06 22:37:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/opml/GNUmakefile.in 2008-07-13 14:10:21.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/opml/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/opml/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/opml/Makefile 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/opml/Makefile 2008-07-13 13:05:46.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_imp_OPML.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/opml/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/opml/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/opml/xp/GNUmakefile.in 2008-04-06 22:37:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/opml/xp/GNUmakefile.in 2008-07-13 14:10:22.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/opml/xp/ie_imp_OPML.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/opml/xp/ie_imp_OPML.h --- abiword-2.6.2/abiword-plugins/wp/impexp/opml/xp/ie_imp_OPML.h 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/opml/xp/ie_imp_OPML.h 2008-07-13 13:05:46.000000000 +0100 @@ -27,7 +27,7 @@ #include "fl_AutoNum.h" -class ABI_EXPORT IE_Imp_OPML_Sniffer : public IE_ImpSniffer +class IE_Imp_OPML_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -42,7 +42,7 @@ virtual UT_Error constructImporter (PD_Document * pDocument, IE_Imp ** ppie); }; -class ABI_EXPORT IE_Imp_OPML : public IE_Imp_XML +class IE_Imp_OPML : public IE_Imp_XML { public: IE_Imp_OPML(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/opml/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/opml/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/opml/xp/Makefile 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/opml/xp/Makefile 2008-07-13 13:05:46.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_imp_OPML.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/GNUmakefile.in 2008-04-06 22:37:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/GNUmakefile.in 2008-07-13 14:10:22.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/Makefile 2008-04-06 22:36:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/Makefile 2008-07-13 13:05:33.000000000 +0100 @@ -30,6 +30,8 @@ OBJS= $(OBJDIR)/ie_exp_passepartout.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impexp_passepartout.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/xp/GNUmakefile.in 2008-04-06 22:37:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/xp/GNUmakefile.in 2008-07-13 14:10:22.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/xp/ie_exp_Passepartout.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/xp/ie_exp_Passepartout.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/xp/ie_exp_Passepartout.cpp 2008-04-06 22:36:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/xp/ie_exp_Passepartout.cpp 2008-07-13 13:05:33.000000000 +0100 @@ -36,7 +36,7 @@ /*****************************************************************/ /*****************************************************************/ -class ABI_EXPORT IE_Exp_Passepartout : public IE_Exp +class IE_Exp_Passepartout : public IE_Exp { public: IE_Exp_Passepartout(PD_Document * pDocument); @@ -55,7 +55,7 @@ // into a passepartout stream. ////////////////////////////////////////////////////////////////// -class ABI_EXPORT Passepartout_Listener : public PL_Listener +class Passepartout_Listener : public PL_Listener { public: Passepartout_Listener(PD_Document * pDocument, diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/xp/ie_exp_Passepartout.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/xp/ie_exp_Passepartout.h --- abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/xp/ie_exp_Passepartout.h 2008-04-06 22:36:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/xp/ie_exp_Passepartout.h 2008-07-13 13:05:33.000000000 +0100 @@ -29,7 +29,7 @@ // The exporter/writer for Plain Passepartout Files. -class ABI_EXPORT IE_Exp_Passepartout_Sniffer : public IE_ExpSniffer +class IE_Exp_Passepartout_Sniffer : public IE_ExpSniffer { friend class IE_Exp; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/passepartout/xp/Makefile 2008-04-06 22:36:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/passepartout/xp/Makefile 2008-07-13 13:05:33.000000000 +0100 @@ -25,6 +25,8 @@ CPPSRCS= ie_exp_Passepartout.cpp \ ie_impexp_Passepartout.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdb/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdb/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/pdb/GNUmakefile.in 2008-04-06 22:37:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdb/GNUmakefile.in 2008-07-13 14:10:23.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdb/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdb/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/pdb/Makefile 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdb/Makefile 2008-07-13 13:05:46.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_PalmDoc.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impexp_PalmDoc.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdb/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdb/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/pdb/xp/GNUmakefile.in 2008-04-06 22:37:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdb/xp/GNUmakefile.in 2008-07-13 14:10:23.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdb/xp/ie_exp_PalmDoc.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdb/xp/ie_exp_PalmDoc.h --- abiword-2.6.2/abiword-plugins/wp/impexp/pdb/xp/ie_exp_PalmDoc.h 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdb/xp/ie_exp_PalmDoc.h 2008-07-13 13:05:46.000000000 +0100 @@ -32,7 +32,7 @@ /*****************************************************************/ /*****************************************************************/ -class ABI_EXPORT IE_Exp_PalmDoc_Sniffer : public IE_ExpSniffer +class IE_Exp_PalmDoc_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -48,7 +48,7 @@ IE_Exp ** ppie); }; -class ABI_EXPORT IE_Exp_PalmDoc : public IE_Exp_Text +class IE_Exp_PalmDoc : public IE_Exp_Text { public: IE_Exp_PalmDoc(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdb/xp/ie_imp_PalmDoc.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdb/xp/ie_imp_PalmDoc.h --- abiword-2.6.2/abiword-plugins/wp/impexp/pdb/xp/ie_imp_PalmDoc.h 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdb/xp/ie_imp_PalmDoc.h 2008-07-13 13:05:46.000000000 +0100 @@ -32,7 +32,7 @@ // The importer/reader for Palm Doc Database Files. -class ABI_EXPORT IE_Imp_PalmDoc_Sniffer : public IE_ImpSniffer +class IE_Imp_PalmDoc_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -52,7 +52,7 @@ }; -class ABI_EXPORT IE_Imp_PalmDoc : public IE_Imp +class IE_Imp_PalmDoc : public IE_Imp { public: IE_Imp_PalmDoc(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdb/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdb/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/pdb/xp/Makefile 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdb/xp/Makefile 2008-07-13 13:05:46.000000000 +0100 @@ -26,6 +26,8 @@ ie_imp_PalmDoc.cpp \ ie_impexp_PalmDoc.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdf/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdf/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/pdf/GNUmakefile.in 2008-04-06 22:37:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdf/GNUmakefile.in 2008-07-13 14:10:23.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdf/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdf/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/pdf/Makefile 2008-04-06 22:37:09.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdf/Makefile 2008-07-13 13:05:47.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_exp_PDF_sniffer.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_exp_PDF_util.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdf/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdf/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/pdf/xp/GNUmakefile.in 2008-04-06 22:37:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdf/xp/GNUmakefile.in 2008-07-13 14:10:23.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdf/xp/ie_imp_PDF.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdf/xp/ie_imp_PDF.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/pdf/xp/ie_imp_PDF.cpp 2008-04-06 22:37:09.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdf/xp/ie_imp_PDF.cpp 2008-07-13 13:05:47.000000000 +0100 @@ -60,7 +60,7 @@ return UT_OK; } -class ABI_EXPORT IE_Imp_PDF : public IE_Imp +class IE_Imp_PDF : public IE_Imp { public: @@ -165,7 +165,7 @@ { IE_MIME_MATCH_BOGUS, "", UT_CONFIDENCE_ZILCH } }; -class ABI_EXPORT IE_Imp_PDF_Sniffer : public IE_ImpSniffer +class IE_Imp_PDF_Sniffer : public IE_ImpSniffer { public: diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/pdf/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/pdf/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/pdf/xp/Makefile 2008-04-06 22:37:09.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/pdf/xp/Makefile 2008-07-13 13:05:47.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_exp_PDF.cpp ie_exp_PDF_util.cpp \ ie_exp_PDF_sniffer.cpp + +CFLAGS+= -DABI_DLL ifeq ($(OS_NAME), MINGW32) INCLUDES+= -I$(ABI_ZLIB_INC) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/psion/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/psion/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/psion/GNUmakefile.in 2008-04-06 22:37:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/psion/GNUmakefile.in 2008-07-13 14:10:23.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/psion/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/psion/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/psion/Makefile 2008-04-06 22:36:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/psion/Makefile 2008-07-13 13:05:30.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_Psion.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_exp_Psion.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) # common to all Win32 compilers diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/psion/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/psion/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/psion/xp/GNUmakefile.in 2008-04-06 22:37:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/psion/xp/GNUmakefile.in 2008-07-13 14:10:24.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/psion/xp/ie_exp_Psion.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/psion/xp/ie_exp_Psion.h --- abiword-2.6.2/abiword-plugins/wp/impexp/psion/xp/ie_exp_Psion.h 2008-04-06 22:36:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/psion/xp/ie_exp_Psion.h 2008-07-13 13:05:30.000000000 +0100 @@ -38,7 +38,7 @@ * This sniffer class is specific for Psion Word files. It does not extend * the basic IE_ExpSniffer class. */ -class ABI_PLUGIN_EXPORT IE_Exp_Psion_Word_Sniffer : public IE_ExpSniffer +class IE_Exp_Psion_Word_Sniffer : public IE_ExpSniffer { public: IE_Exp_Psion_Word_Sniffer (const char * name): IE_ExpSniffer(name) {} @@ -58,7 +58,7 @@ * This sniffer class is specific for Psion TextEd files. It does not extend * the basic IE_ExpSniffer class. */ -class ABI_PLUGIN_EXPORT IE_Exp_Psion_TextEd_Sniffer : public IE_ExpSniffer +class IE_Exp_Psion_TextEd_Sniffer : public IE_ExpSniffer { public: IE_Exp_Psion_TextEd_Sniffer (const char * name): IE_ExpSniffer(name) {} @@ -202,7 +202,7 @@ * the _writeDocument method, which you do not need to override in the * derived classes. */ -class ABI_PLUGIN_EXPORT IE_Exp_Psion: public IE_Exp +class IE_Exp_Psion: public IE_Exp { public: // Constructors and destructor @@ -224,7 +224,7 @@ * The only method which this class overrides is the _constructListener * method, that is made to return a listener of type PL_Psion_TextEd_Listener. */ -class ABI_PLUGIN_EXPORT IE_Exp_Psion_TextEd : public IE_Exp_Psion +class IE_Exp_Psion_TextEd : public IE_Exp_Psion { public: // Constructors and destructor @@ -243,7 +243,7 @@ * The only method which this class overrides is the _constructListener * method, that is made to return a listener of type PL_Psion_Word_Listener. */ -class ABI_PLUGIN_EXPORT IE_Exp_Psion_Word : public IE_Exp_Psion +class IE_Exp_Psion_Word : public IE_Exp_Psion { public: // Constructors and destructor diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/psion/xp/ie_imp_Psion.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/psion/xp/ie_imp_Psion.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/psion/xp/ie_imp_Psion.cpp 2008-04-06 22:36:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/psion/xp/ie_imp_Psion.cpp 2008-07-13 13:05:30.000000000 +0100 @@ -522,6 +522,7 @@ if ((res = readParagraphs(layout->footer->text->paragraphs,NULL))) return res; } + return res; } /*! diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/psion/xp/ie_imp_Psion.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/psion/xp/ie_imp_Psion.h --- abiword-2.6.2/abiword-plugins/wp/impexp/psion/xp/ie_imp_Psion.h 2008-04-06 22:36:57.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/psion/xp/ie_imp_Psion.h 2008-07-13 13:05:30.000000000 +0100 @@ -35,7 +35,7 @@ // The importer/reader for Psion Word and TextEd Files. -class ABI_PLUGIN_EXPORT IE_Imp_Psion_Sniffer : public IE_ImpSniffer +class IE_Imp_Psion_Sniffer : public IE_ImpSniffer { public: IE_Imp_Psion_Sniffer(const char * name): IE_ImpSniffer(name) {} @@ -45,7 +45,7 @@ psiconv_file_type_t filetype); }; -class ABI_PLUGIN_EXPORT IE_Imp_Psion_Word_Sniffer : public IE_Imp_Psion_Sniffer +class IE_Imp_Psion_Word_Sniffer : public IE_Imp_Psion_Sniffer { public: IE_Imp_Psion_Word_Sniffer(const char * name): IE_Imp_Psion_Sniffer(name) {} @@ -62,7 +62,7 @@ IE_Imp ** ppie); }; -class ABI_PLUGIN_EXPORT IE_Imp_Psion_TextEd_Sniffer : +class IE_Imp_Psion_TextEd_Sniffer : public IE_Imp_Psion_Sniffer { public: @@ -81,7 +81,7 @@ IE_Imp ** ppie); }; -class ABI_PLUGIN_EXPORT IE_Imp_Psion : public IE_Imp +class IE_Imp_Psion : public IE_Imp { public: IE_Imp_Psion(PD_Document * pDocument): IE_Imp(pDocument),list(false) {} @@ -115,7 +115,7 @@ bool list; }; -class ABI_PLUGIN_EXPORT IE_Imp_Psion_Word : public IE_Imp_Psion +class IE_Imp_Psion_Word : public IE_Imp_Psion { public: IE_Imp_Psion_Word(PD_Document * pDocument): IE_Imp_Psion(pDocument) {} @@ -125,7 +125,7 @@ virtual UT_Error parseFile(const psiconv_file psionfile); }; -class ABI_PLUGIN_EXPORT IE_Imp_Psion_TextEd : public IE_Imp_Psion +class IE_Imp_Psion_TextEd : public IE_Imp_Psion { public: IE_Imp_Psion_TextEd(PD_Document * pDocument): IE_Imp_Psion(pDocument) {} diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/sdw/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/sdw/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/sdw/GNUmakefile.in 2008-04-06 22:37:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/sdw/GNUmakefile.in 2008-07-13 14:10:24.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/sdw/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/sdw/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/sdw/Makefile 2008-04-06 22:37:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/sdw/Makefile 2008-07-13 13:05:35.000000000 +0100 @@ -32,6 +32,8 @@ $(OBJDIR)/sdw_cryptor.$(OBJ_SUFFIX) \ $(OBJDIR)/docinfo.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= $(ABI_GSF_LIB) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/docinfo.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/docinfo.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/docinfo.cpp 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/docinfo.cpp 2008-07-13 13:05:35.000000000 +0100 @@ -113,66 +113,76 @@ aDoc->setMetaDataProp(aKey, str); } -void SDWDocInfo::load(GsfInfile* aDoc, PD_Document* aPDDoc) UT_THROWS((UT_Error)) { - UT_DEBUGMSG(("SDW: Loading Docinfo...\n")); - // firstly, set StarOffice as generator - aPDDoc->setMetaDataProp(PD_META_KEY_GENERATOR, UT_UTF8String("StarOffice")); - AutoGsfInput docInfo = gsf_infile_child_by_name(aDoc, "SfxDocumentInfo"); - if (!(GsfInput*)docInfo) - UT_THROW(UT_IE_BOGUSDOCUMENT); - - char* headStr; - readByteString(docInfo, headStr); - if (strcmp(headStr, "SfxDocumentInfo") != 0) - UT_THROW(UT_IE_BOGUSDOCUMENT); - - UT_uint16 version; - streamRead(docInfo, version); - bool pwProtect; - streamRead(docInfo, pwProtect); - UT_uint16 charset; - streamRead(docInfo, charset); - auto_iconv converter(findConverter((UT_uint8)charset)); - if (!UT_iconv_isValid(converter)) - UT_THROW(UT_IE_BOGUSDOCUMENT); - - bool graphPortable, queryTemplateReload; - streamRead(docInfo, graphPortable); - streamRead(docInfo, queryTemplateReload); - - TimeStamp stamp(converter); - stamp.load(docInfo); // creator - do_SetMetadata(aPDDoc, PD_META_KEY_CREATOR, stamp.mString); - aPDDoc->setMetaDataProp(PD_META_KEY_DATE, stamp.ToString()); - stamp.load(docInfo); // modifier - // (ab-)using Contributor as the person who last modified the doc... - do_SetMetadata(aPDDoc, PD_META_KEY_CONTRIBUTOR, stamp.mString); - aPDDoc->setMetaDataProp(PD_META_KEY_DATE_LAST_CHANGED, stamp.ToString()); - stamp.load(docInfo); // printer (person, not device) - - UT_UCS4String data; - readPaddedByteString(docInfo, data, converter, 63); - do_SetMetadata(aPDDoc, PD_META_KEY_TITLE, data); - readPaddedByteString(docInfo, data, converter, 63); - do_SetMetadata(aPDDoc, PD_META_KEY_SUBJECT, data); - readPaddedByteString(docInfo, data, converter, 255); - do_SetMetadata(aPDDoc, PD_META_KEY_DESCRIPTION, data); - readPaddedByteString(docInfo, data, converter, 127); - do_SetMetadata(aPDDoc, PD_META_KEY_KEYWORDS, data); - - // Read user-defined data - for (int i = 0; i < 4; i++) { - UT_UCS4String key, value; - readPaddedByteString(docInfo, key, converter, 19); - readPaddedByteString(docInfo, value, converter, 19); - UT_String prefixedKey = CUSTOM_META_PREFIX + UT_String(UT_UTF8String(key).utf8_str()); - do_SetMetadata(aPDDoc, prefixedKey, value); - } +void SDWDocInfo::load(GsfInfile* aDoc, PD_Document* aPDDoc) + UT_THROWS((UT_Error)) +{ + char* headStr = NULL; + + try { + UT_DEBUGMSG(("SDW: Loading Docinfo...\n")); + // firstly, set StarOffice as generator + aPDDoc->setMetaDataProp(PD_META_KEY_GENERATOR, UT_UTF8String("StarOffice")); + AutoGsfInput docInfo = gsf_infile_child_by_name(aDoc, "SfxDocumentInfo"); + if (!(GsfInput*)docInfo) + UT_THROW(UT_IE_BOGUSDOCUMENT); + + readByteString(docInfo, headStr); + if (strcmp(headStr, "SfxDocumentInfo") != 0) + UT_THROW(UT_IE_BOGUSDOCUMENT); + + UT_uint16 version; + streamRead(docInfo, version); + bool pwProtect; + streamRead(docInfo, pwProtect); + UT_uint16 charset; + streamRead(docInfo, charset); + auto_iconv converter(findConverter((UT_uint8)charset)); + if (!UT_iconv_isValid(converter)) + UT_THROW(UT_IE_BOGUSDOCUMENT); + + bool graphPortable, queryTemplateReload; + streamRead(docInfo, graphPortable); + streamRead(docInfo, queryTemplateReload); + + TimeStamp stamp(converter); + stamp.load(docInfo); // creator + do_SetMetadata(aPDDoc, PD_META_KEY_CREATOR, stamp.mString); + aPDDoc->setMetaDataProp(PD_META_KEY_DATE, stamp.ToString()); + stamp.load(docInfo); // modifier + // (ab-)using Contributor as the person who last modified the doc... + do_SetMetadata(aPDDoc, PD_META_KEY_CONTRIBUTOR, stamp.mString); + aPDDoc->setMetaDataProp(PD_META_KEY_DATE_LAST_CHANGED, stamp.ToString()); + stamp.load(docInfo); // printer (person, not device) + + UT_UCS4String data; + readPaddedByteString(docInfo, data, converter, 63); + do_SetMetadata(aPDDoc, PD_META_KEY_TITLE, data); + readPaddedByteString(docInfo, data, converter, 63); + do_SetMetadata(aPDDoc, PD_META_KEY_SUBJECT, data); + readPaddedByteString(docInfo, data, converter, 255); + do_SetMetadata(aPDDoc, PD_META_KEY_DESCRIPTION, data); + readPaddedByteString(docInfo, data, converter, 127); + do_SetMetadata(aPDDoc, PD_META_KEY_KEYWORDS, data); + + // Read user-defined data + for (int i = 0; i < 4; i++) { + UT_UCS4String key, value; + readPaddedByteString(docInfo, key, converter, 19); + readPaddedByteString(docInfo, value, converter, 19); + UT_String prefixedKey = CUSTOM_META_PREFIX + UT_String(UT_UTF8String(key).utf8_str()); + do_SetMetadata(aPDDoc, prefixedKey, value); + } - // rest of the stream contains no useful information + // rest of the stream contains no useful information - // FIXME make sure the exception cleanup go here... - delete [] headStr; - UT_DEBUGMSG(("SDW: Docinfo done loading\n")); + delete [] headStr; + UT_DEBUGMSG(("SDW: Docinfo done loading\n")); + } + catch(UT_Error & e) { + if(headStr) { + delete [] headStr; + } + throw e; + } } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/docinfo.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/docinfo.h --- abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/docinfo.h 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/docinfo.h 2008-07-13 13:05:35.000000000 +0100 @@ -31,7 +31,7 @@ /** Class for reading the DocInfo stream (=metadata) and setting it on a * PD_Document */ -class ABI_EXPORT SDWDocInfo { +class SDWDocInfo { public: SDWDocInfo(); ~SDWDocInfo(); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/GNUmakefile.in 2008-04-06 22:38:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/GNUmakefile.in 2008-07-13 14:10:24.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/ie_imp_StarOffice.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/ie_imp_StarOffice.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/ie_imp_StarOffice.cpp 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/ie_imp_StarOffice.cpp 2008-07-13 13:05:35.000000000 +0100 @@ -327,8 +327,8 @@ // Data structure: // Count(8) | Position (in twips) (32) | Adjustment (8) | Decimal Separator (?) (8) | Fill character (8) // (total size per tab = 7) - UT_sint8 count = aAttr.data[0]; - for (int i = 1; (i + 6) < aAttr.dataLen; i += 7) { + // UT_sint8 count = aAttr.data[0]; + for (UT_uint32 i = 1; (i + 6) < aAttr.dataLen; i += 7) { // Abiword wants: 12.3cm/L0, where 0 indicates what to fill with UT_uint16 posInTwips = GSF_LE_GET_GUINT32(aAttr.data + i); UT_String pos = twipsToSizeString(posInTwips); @@ -377,7 +377,7 @@ static void hexdump(void* aPtr, UT_uint32 aLen) { unsigned char* ptr = (unsigned char*)aPtr; for (UT_uint32 i = 0; i < aLen; i++) { - fprintf(stderr, "%02x ", ptr[i], ptr[i]); + fprintf(stderr, "%02x ", ptr[i]); } } #endif @@ -787,9 +787,9 @@ // now insert the spans of text UT_uint32 len = textNode.length(); UT_uint32 lastInsPos = 0; - for (int i = 1; i < len; i++) { + for (UT_uint32 i = 1; i < len; i++) { bool doInsert = false; // whether there was an attribute change - for (int j = 0; j < charAttributes.getItemCount(); j++) { + for (UT_uint32 j = 0; j < charAttributes.getItemCount(); j++) { const TextAttr* a = reinterpret_cast(charAttributes[j]); // clear the last attribute, if set if (a->endSet && a->end == (i - 1)) { @@ -1031,8 +1031,8 @@ } ABI_FAR_CALL -int abi_plugin_supports_version (UT_uint32 major, UT_uint32 minor, - UT_uint32 release) +int abi_plugin_supports_version (UT_uint32 /*major*/, UT_uint32 /*minor*/, + UT_uint32 /*release*/) { return 1; } diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/ie_imp_StarOffice.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/ie_imp_StarOffice.h --- abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/ie_imp_StarOffice.h 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/ie_imp_StarOffice.h 2008-07-13 13:05:35.000000000 +0100 @@ -59,7 +59,7 @@ * @param cryptor (Optional) The cryptor used for decrypting the string */ void readByteString(GsfInput* stream, UT_UCS4Char*& str, UT_iconv_t converter, SDWCryptor* cryptor = NULL) UT_THROWS((UT_Error)); -class ABI_EXPORT DocHdr { +class DocHdr { public: DocHdr() : sBlockName(NULL), converter(reinterpret_cast(-1)) {} ~DocHdr() { if (sBlockName) free(sBlockName); if (UT_iconv_isValid(converter)) UT_iconv_close(converter); } @@ -161,7 +161,7 @@ #define IDX_NOCONV_FF 0xFFFC // Staroffice document sniffer. -class ABI_EXPORT IE_Imp_StarOffice_Sniffer : public IE_ImpSniffer +class IE_Imp_StarOffice_Sniffer : public IE_ImpSniffer { public: IE_Imp_StarOffice_Sniffer(); @@ -175,7 +175,7 @@ }; // Actual Importer -class ABI_EXPORT IE_Imp_StarOffice : public IE_Imp +class IE_Imp_StarOffice : public IE_Imp { public: IE_Imp_StarOffice(PD_Document *pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/Makefile 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/Makefile 2008-07-13 13:05:35.000000000 +0100 @@ -27,6 +27,8 @@ sdw_cryptor.cpp \ docinfo.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= $(ABI_GSF_INC) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/sdw_cryptor.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/sdw_cryptor.h --- abiword-2.6.2/abiword-plugins/wp/impexp/sdw/xp/sdw_cryptor.h 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/sdw/xp/sdw_cryptor.h 2008-07-13 13:05:35.000000000 +0100 @@ -25,7 +25,7 @@ #include "ut_string_class.h" /** Decryptor for .sdw files */ -class ABI_EXPORT SDWCryptor { +class SDWCryptor { public: /** Maximum length of the password */ enum { maxPWLen = 16 }; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/t602/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/t602/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/t602/GNUmakefile.in 2008-04-06 22:38:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/t602/GNUmakefile.in 2008-07-13 14:10:24.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/t602/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/t602/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/t602/Makefile 2008-04-06 22:36:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/t602/Makefile 2008-07-13 13:05:33.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ie_imp_T602.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/t602/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/t602/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/t602/xp/GNUmakefile.in 2008-04-06 22:38:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/t602/xp/GNUmakefile.in 2008-07-13 14:10:25.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/t602/xp/ie_imp_T602.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/t602/xp/ie_imp_T602.h --- abiword-2.6.2/abiword-plugins/wp/impexp/t602/xp/ie_imp_T602.h 2008-04-06 22:36:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/t602/xp/ie_imp_T602.h 2008-07-13 13:05:33.000000000 +0100 @@ -30,7 +30,7 @@ // The importer for T602 documents. -class ABI_EXPORT IE_Imp_T602_Sniffer : public IE_ImpSniffer +class IE_Imp_T602_Sniffer : public IE_ImpSniffer { friend class IE_Imp; friend class IE_Imp_T602; @@ -46,7 +46,7 @@ virtual UT_Error constructImporter (PD_Document * pDocument, IE_Imp ** ppie); }; -class ABI_EXPORT IE_Imp_T602 : public IE_Imp +class IE_Imp_T602 : public IE_Imp { public: IE_Imp_T602(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/t602/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/t602/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/t602/xp/Makefile 2008-04-06 22:36:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/t602/xp/Makefile 2008-07-13 13:05:33.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ie_imp_T602.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wml/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wml/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/wml/GNUmakefile.in 2008-04-06 22:38:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wml/GNUmakefile.in 2008-07-13 14:10:25.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wml/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wml/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/wml/Makefile 2008-04-06 22:37:01.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wml/Makefile 2008-07-13 13:05:37.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_WML.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impexp_WML.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wml/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wml/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/wml/xp/GNUmakefile.in 2008-04-06 22:38:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wml/xp/GNUmakefile.in 2008-07-13 14:10:25.000000000 +0100 @@ -94,6 +94,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wml/xp/ie_exp_WML.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wml/xp/ie_exp_WML.h --- abiword-2.6.2/abiword-plugins/wp/impexp/wml/xp/ie_exp_WML.h 2008-04-06 22:37:01.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wml/xp/ie_exp_WML.h 2008-07-13 13:05:37.000000000 +0100 @@ -30,7 +30,7 @@ // the exporter/writer for WML 1.1 -class ABI_EXPORT IE_Exp_WML_Sniffer : public IE_ExpSniffer +class IE_Exp_WML_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -46,7 +46,7 @@ IE_Exp ** ppie); }; -class ABI_EXPORT IE_Exp_WML : public IE_Exp +class IE_Exp_WML : public IE_Exp { public: IE_Exp_WML(PD_Document *pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wml/xp/ie_imp_WML.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wml/xp/ie_imp_WML.h --- abiword-2.6.2/abiword-plugins/wp/impexp/wml/xp/ie_imp_WML.h 2008-04-06 22:37:01.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wml/xp/ie_imp_WML.h 2008-07-13 13:05:37.000000000 +0100 @@ -30,7 +30,7 @@ // The importer/reader for WML files. -class ABI_EXPORT IE_Imp_WML_Sniffer : public IE_ImpSniffer +class IE_Imp_WML_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -50,7 +50,7 @@ }; -class ABI_EXPORT IE_Imp_WML : public IE_Imp_XML +class IE_Imp_WML : public IE_Imp_XML { public: IE_Imp_WML(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wml/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wml/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/wml/xp/Makefile 2008-04-06 22:37:01.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wml/xp/Makefile 2008-07-13 13:05:37.000000000 +0100 @@ -26,6 +26,8 @@ ie_imp_WML.cpp \ ie_impexp_WML.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/GNUmakefile.in 2008-04-06 22:38:00.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/GNUmakefile.in 2008-07-13 14:10:25.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/Makefile 2008-04-06 22:36:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/Makefile 2008-07-13 13:05:29.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_WordPerfect.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_exp_WordPerfect.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= $(shell pkg-config --libs libwpd-0.8) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/GNUmakefile.in 2008-04-06 22:38:01.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/GNUmakefile.in 2008-07-13 14:10:26.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/ie_exp_WordPerfect.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/ie_exp_WordPerfect.h --- abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/ie_exp_WordPerfect.h 2008-04-06 22:36:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/ie_exp_WordPerfect.h 2008-07-13 13:05:29.000000000 +0100 @@ -59,7 +59,7 @@ // The exporter for WordPerfect 6/7/8/9 documents. -class ABI_EXPORT IE_Exp_WordPerfect_Sniffer : public IE_ExpSniffer +class IE_Exp_WordPerfect_Sniffer : public IE_ExpSniffer { friend class IE_Exp; friend class IE_Exp_WordPerfect; @@ -76,7 +76,7 @@ IE_Exp ** ppie); }; -class ABI_EXPORT IE_Exp_WordPerfect : public IE_Exp +class IE_Exp_WordPerfect : public IE_Exp { friend class WordPerfect_Listener; @@ -103,7 +103,7 @@ int m_ptrDesiredFontUseCount; }; -class ABI_EXPORT WordPerfect_Listener : public PL_Listener +class WordPerfect_Listener : public PL_Listener { public: WordPerfect_Listener(PD_Document * pDocument, diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.cpp --- abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.cpp 2008-04-06 22:36:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.cpp 2008-07-13 13:05:29.000000000 +0100 @@ -313,6 +313,7 @@ m_bParagraphInSection(false), m_bInSection(false), m_bSectionChanged(false), + m_bRequireBlock(false), m_iCurrentListLevel(0), m_bInCell(false), m_bHdrFtrOpenCount(0) @@ -541,6 +542,7 @@ propsArray[1] = propBuffer.c_str(); propsArray[2] = NULL; X_CheckDocumentError(appendStrux(PTX_Block, propsArray)); + m_bRequireBlock = false; if (propList["fo:break-before"]) { @@ -880,6 +882,7 @@ listAttribs[attribsCount++] = NULL; X_CheckDocumentError(appendStrux(PTX_Block, listAttribs)); + m_bRequireBlock = false; // hang text off of a list label getDoc()->appendFmtMark(); @@ -902,6 +905,13 @@ { if (m_bHdrFtrOpenCount) return; // HACK + if (!m_bInSection) + { + X_CheckDocumentError(appendStrux(PTX_Section, NULL)); + X_CheckDocumentError(appendStrux(PTX_Block,NULL)); + m_bInSection = true; + } + const gchar** propsArray = NULL; UT_String footnoteId; @@ -921,6 +931,7 @@ X_CheckDocumentError(appendStrux(PTX_SectionFootnote,attribs)); X_CheckDocumentError(appendStrux(PTX_Block,NULL)); + m_bRequireBlock = false; propsArray = static_cast(UT_calloc(7, sizeof(gchar *))); propsArray [0] = "type"; @@ -961,6 +972,7 @@ X_CheckDocumentError(appendStrux(PTX_SectionEndnote,attribs)); X_CheckDocumentError(appendStrux(PTX_Block,NULL)); + m_bRequireBlock = false; propsArray = static_cast(UT_calloc(7, sizeof(gchar *))); propsArray [0] = "type"; @@ -1114,6 +1126,7 @@ // FIXME: NEED TO PASS THE CURRENT PROPERTIES INSTEAD OF NULL // NOTE: THIS SUCKS......... X_CheckDocumentError(appendStrux(PTX_Block, NULL)); + m_bRequireBlock = false; } UT_Error IE_Imp_WordPerfect::_appendSection(int numColumns, const float marginLeft, const float marginRight) @@ -1123,6 +1136,11 @@ UT_String myProps("") ; UT_LocaleTransactor lt(LC_NUMERIC, "C"); myProps += UT_String_sprintf("columns:%d; page-margin-left:%.4fin; page-margin-right:%.4fin", numColumns, marginLeft, marginRight); + + if(m_bInSection && m_bRequireBlock) // AbiWord will hang on an empty
+ { + X_CheckDocumentError(appendStrux(PTX_Block,NULL)); + } const gchar * propsArray[3]; propsArray[0] = "props"; @@ -1131,6 +1149,7 @@ X_CheckDocumentError(appendStrux(PTX_Section, propsArray)); m_bInSection = true; + m_bRequireBlock = true; m_bSectionChanged = false; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.h --- abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.h 2008-04-06 22:36:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/ie_imp_WordPerfect.h 2008-07-13 13:05:29.000000000 +0100 @@ -74,7 +74,7 @@ int m_iOutlineHash; }; -class ABI_EXPORT IE_Imp_WordPerfect_Sniffer : public IE_ImpSniffer +class IE_Imp_WordPerfect_Sniffer : public IE_ImpSniffer { friend class IE_Imp; friend class IE_Imp_WordPerfect; @@ -93,7 +93,7 @@ IE_Imp ** ppie); }; -class ABI_EXPORT IE_Imp_WordPerfect : public IE_Imp, public WPXHLListenerImpl +class IE_Imp_WordPerfect : public IE_Imp, public WPXHLListenerImpl { public: IE_Imp_WordPerfect(PD_Document * pDocument); @@ -189,6 +189,7 @@ bool m_bParagraphInSection; bool m_bInSection; bool m_bSectionChanged; + bool m_bRequireBlock; int m_iCurrentListLevel; bool m_bInCell; @@ -199,7 +200,7 @@ #ifdef HAVE_LIBWPS -class ABI_EXPORT IE_Imp_MSWorks_Sniffer : public IE_ImpSniffer +class IE_Imp_MSWorks_Sniffer : public IE_ImpSniffer { friend class IE_Imp; friend class IE_Imp_MSWorks; diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/wordperfect/xp/Makefile 2008-04-06 22:36:56.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/wordperfect/xp/Makefile 2008-07-13 13:05:29.000000000 +0100 @@ -26,6 +26,8 @@ ie_imp_WordPerfect.cpp \ ie_exp_WordPerfect.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) INCLUDES+= $(shell pkg-config --cflags libwpd-0.8) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/GNUmakefile.in 2008-04-06 22:38:01.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/GNUmakefile.in 2008-07-13 14:10:26.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/Makefile 2008-04-06 22:36:59.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/Makefile 2008-07-13 13:05:34.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/HTML_Parser.$(OBJ_SUFFIX) \ $(OBJDIR)/HTML_StyleString.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) OS_LIBS+= wsock32.lib ole32.lib oleaut32.lib EXTRA_LIBS+= $(BINDIR)/AbiWord.$(LIB_SUFFIX) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/xp/GNUmakefile.in 2008-04-06 22:38:01.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/xp/GNUmakefile.in 2008-07-13 14:10:26.000000000 +0100 @@ -101,6 +101,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/xp/ie_imp_MHT.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/xp/ie_imp_MHT.h --- abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/xp/ie_imp_MHT.h 2008-04-06 22:36:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/xp/ie_imp_MHT.h 2008-07-13 13:05:33.000000000 +0100 @@ -40,7 +40,7 @@ //class UT_StringPtrMap; //class UT_Vector; -class ABI_EXPORT UT_Multipart +class UT_Multipart { enum ContentTransferEncoding { @@ -102,7 +102,7 @@ char m_b64buffer[80]; }; -class ABI_EXPORT IE_Imp_MHT_Sniffer : public IE_ImpSniffer +class IE_Imp_MHT_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -121,7 +121,7 @@ UT_Error constructImporter (PD_Document * pDocument, IE_Imp ** ppie); }; -class ABI_EXPORT IE_Imp_MHT : public IE_Imp_XHTML +class IE_Imp_MHT : public IE_Imp_XHTML { public: IE_Imp_MHT (PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/xp/Makefile 2008-04-06 22:36:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/xp/Makefile 2008-07-13 13:05:34.000000000 +0100 @@ -26,6 +26,8 @@ HTML_Parser.cpp \ HTML_StyleString.cpp +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) DEFINES+=-DABI_PLUGIN_VERSION=\"2.0.0\" INCLUDES+= -I$(ABI_ROOT)/../libs/libxml diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/xp/tidyImporter.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/xp/tidyImporter.h --- abiword-2.6.2/abiword-plugins/wp/impexp/xhtml/xp/tidyImporter.h 2008-04-06 22:36:58.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xhtml/xp/tidyImporter.h 2008-07-13 13:05:33.000000000 +0100 @@ -22,7 +22,7 @@ #include "ie_imp_XHTML.h" -class ABI_EXPORT IE_Imp_Tidy_Sniffer : public IE_ImpSniffer +class IE_Imp_Tidy_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -42,7 +42,7 @@ virtual UT_Error constructImporter (PD_Document * pDocument, IE_Imp ** ppie); }; -class ABI_EXPORT IE_Imp_HTML : public IE_Imp_XHTML +class IE_Imp_HTML : public IE_Imp_XHTML { public: IE_Imp_HTML (PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/GNUmakefile.in 2008-04-06 22:38:01.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/GNUmakefile.in 2008-07-13 14:10:27.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/Makefile 2008-04-06 22:37:09.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/Makefile 2008-07-13 13:05:47.000000000 +0100 @@ -31,6 +31,8 @@ $(OBJDIR)/ie_imp_XSL-FO.$(OBJ_SUFFIX) \ $(OBJDIR)/ie_impexp_XSL-FO.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) ifeq ($(OS_NAME), MINGW32) EXTRA_LIBS+= -lAbiWord.exe diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/xp/GNUmakefile.in 2008-04-06 22:38:02.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/xp/GNUmakefile.in 2008-07-13 14:10:27.000000000 +0100 @@ -95,6 +95,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/xp/ie_exp_XSL-FO.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/xp/ie_exp_XSL-FO.h --- abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/xp/ie_exp_XSL-FO.h 2008-04-06 22:37:09.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/xp/ie_exp_XSL-FO.h 2008-07-13 13:05:46.000000000 +0100 @@ -30,7 +30,7 @@ // The exporter/writer for the XML/XSL FO spec -class ABI_EXPORT IE_Exp_XSL_FO_Sniffer : public IE_ExpSniffer +class IE_Exp_XSL_FO_Sniffer : public IE_ExpSniffer { friend class IE_Exp; @@ -46,7 +46,7 @@ IE_Exp ** ppie); }; -class ABI_EXPORT IE_Exp_XSL_FO : public IE_Exp +class IE_Exp_XSL_FO : public IE_Exp { public: IE_Exp_XSL_FO(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/xp/ie_imp_XSL-FO.h /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/xp/ie_imp_XSL-FO.h --- abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/xp/ie_imp_XSL-FO.h 2008-04-06 22:37:08.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/xp/ie_imp_XSL-FO.h 2008-07-13 13:05:46.000000000 +0100 @@ -29,7 +29,7 @@ // The importer/reader for XSL-FO files. -class ABI_EXPORT IE_Imp_XSL_FO_Sniffer : public IE_ImpSniffer +class IE_Imp_XSL_FO_Sniffer : public IE_ImpSniffer { friend class IE_Imp; @@ -49,7 +49,7 @@ }; -class ABI_EXPORT IE_Imp_XSL_FO : public IE_Imp_XML +class IE_Imp_XSL_FO : public IE_Imp_XML { public: IE_Imp_XSL_FO(PD_Document * pDocument); diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/impexp/xsl-fo/xp/Makefile 2008-04-06 22:37:09.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/impexp/xsl-fo/xp/Makefile 2008-07-13 13:05:47.000000000 +0100 @@ -26,6 +26,8 @@ ie_imp_XSL-FO.cpp \ ie_impexp_XSL-FO.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk build:: $(TARGETS) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/scripts/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/scripts/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/scripts/GNUmakefile.in 2008-04-06 22:38:02.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/scripts/GNUmakefile.in 2008-07-13 14:10:27.000000000 +0100 @@ -66,6 +66,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/scripts/shell/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/scripts/shell/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/scripts/shell/GNUmakefile.in 2008-04-06 22:38:02.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/scripts/shell/GNUmakefile.in 2008-07-13 14:10:27.000000000 +0100 @@ -67,6 +67,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/scripts/shell/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/scripts/shell/Makefile --- abiword-2.6.2/abiword-plugins/wp/scripts/shell/Makefile 2008-04-06 22:37:11.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/scripts/shell/Makefile 2008-07-13 13:05:50.000000000 +0100 @@ -29,6 +29,8 @@ OBJS= $(OBJDIR)/ScriptHappy.$(OBJ_SUFFIX) +CFLAGS+= -DABI_DLL + ifeq ($(ABI_FE), Win32) EXTRA_LIBS+= $(OBJDIR)/abi_ver.$(OBJ_SUFFIX) # EXTRA_LIBS+= $(OBJDIR)/libAbiUtil_s.$(LIB_SUFFIX) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/scripts/shell/xp/GNUmakefile.in /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/scripts/shell/xp/GNUmakefile.in --- abiword-2.6.2/abiword-plugins/wp/scripts/shell/xp/GNUmakefile.in 2008-04-06 22:38:02.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/scripts/shell/xp/GNUmakefile.in 2008-07-13 14:10:28.000000000 +0100 @@ -85,6 +85,8 @@ ABICOLLAB_LIBXML2_LIBS = @ABICOLLAB_LIBXML2_LIBS@ ABICOLLAB_SERVICE_CPPFLAGS = @ABICOLLAB_SERVICE_CPPFLAGS@ ABICOLLAB_SERVICE_LIBS = @ABICOLLAB_SERVICE_LIBS@ +ABICOLLAB_SOUP_CFLAGS = @ABICOLLAB_SOUP_CFLAGS@ +ABICOLLAB_SOUP_LIBS = @ABICOLLAB_SOUP_LIBS@ ABICOLLAB_SUGAR_CPPFLAGS = @ABICOLLAB_SUGAR_CPPFLAGS@ ABICOLLAB_SUGAR_LIBS = @ABICOLLAB_SUGAR_LIBS@ ABICOLLAB_TCP_CPPFLAGS = @ABICOLLAB_TCP_CPPFLAGS@ diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/scripts/shell/xp/Makefile /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/scripts/shell/xp/Makefile --- abiword-2.6.2/abiword-plugins/wp/scripts/shell/xp/Makefile 2008-04-06 22:37:11.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/scripts/shell/xp/Makefile 2008-07-13 13:05:49.000000000 +0100 @@ -24,6 +24,8 @@ TARGETS= $(OBJS) CPPSRCS= ScriptHappy.cpp +CFLAGS+= -DABI_DLL + include $(ABI_ROOT)/src/config/abi_rules.mk #ifeq ($(ABI_FE), Win32) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/abiword-plugins/wp/scripts/shell/xp/ScriptHappy.cpp /tmp/qY2gb79Nml/abiword-2.6.4/abiword-plugins/wp/scripts/shell/xp/ScriptHappy.cpp --- abiword-2.6.2/abiword-plugins/wp/scripts/shell/xp/ScriptHappy.cpp 2008-04-06 22:37:11.000000000 +0100 +++ abiword-2.6.4/abiword-plugins/wp/scripts/shell/xp/ScriptHappy.cpp 2008-07-13 13:05:49.000000000 +0100 @@ -86,7 +86,7 @@ * */ -class ABI_EXPORT ScriptHappy : public UT_Script +class ScriptHappy : public UT_Script { public: ScriptHappy () @@ -134,7 +134,7 @@ } ; -class ABI_EXPORT ScriptHappy_Sniffer : public UT_ScriptSniffer +class ScriptHappy_Sniffer : public UT_ScriptSniffer { public : ScriptHappy_Sniffer() diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-common.dirs /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-common.dirs --- abiword-2.6.2/debian/abiword-common.dirs 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/debian/abiword-common.dirs 2008-07-18 04:24:35.000000000 +0100 @@ -0,0 +1 @@ +usr/share/pixmaps diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-dev.files /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-dev.files --- abiword-2.6.2/debian/abiword-dev.files 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword-dev.files 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -/usr/include diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword.dirs /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword.dirs --- abiword-2.6.2/debian/abiword.dirs 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword.dirs 2008-07-18 04:24:35.000000000 +0100 @@ -1,6 +1,5 @@ usr/bin usr/share/applications usr/share/mime-info -usr/share/pixmaps usr/share/application-registry diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword.files /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword.files --- abiword-2.6.2/debian/abiword.files 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/debian/abiword.files 2008-07-18 04:24:35.000000000 +0100 @@ -0,0 +1,3 @@ +usr/bin/abiword +usr/lib/abiword-2.6 +usr/share/applications diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-help.doc-base /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-help.doc-base --- abiword-2.6.2/debian/abiword-help.doc-base 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword-help.doc-base 2008-07-18 04:24:35.000000000 +0100 @@ -4,7 +4,7 @@ Abstract: This set of documents provides help for using the AbiWord word processor, meant to be accessed from within the program itself but also available here. -Section: Apps/Editors +Section: Office Format: html Index: /usr/share/doc/abiword-help/html/index.html diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugin-goffice.dirs /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugin-goffice.dirs --- abiword-2.6.2/debian/abiword-plugin-goffice.dirs 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugin-goffice.dirs 2008-07-18 04:24:35.000000000 +0100 @@ -0,0 +1 @@ +usr/lib/abiword-2.6/plugins diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugin-grammar.dirs /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugin-grammar.dirs --- abiword-2.6.2/debian/abiword-plugin-grammar.dirs 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugin-grammar.dirs 2008-07-18 04:24:35.000000000 +0100 @@ -0,0 +1 @@ +usr/lib/abiword-2.6/plugins diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugin-mathview.dirs /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugin-mathview.dirs --- abiword-2.6.2/debian/abiword-plugin-mathview.dirs 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugin-mathview.dirs 2008-07-18 04:24:35.000000000 +0100 @@ -0,0 +1 @@ +usr/lib/abiword-2.6/plugins diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugins.dirs /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugins.dirs --- abiword-2.6.2/debian/abiword-plugins.dirs 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugins.dirs 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -usr/share/applications -usr/share/mime-info -usr/share/application-registry - diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugins.files /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugins.files --- abiword-2.6.2/debian/abiword-plugins.files 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugins.files 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -usr/lib/abiword-2.6/plugins/libAbiGrammar.* -usr/lib/abiword-2.6/plugins/libAbiMathView.* - diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugins-gnome.files /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugins-gnome.files --- abiword-2.6.2/debian/abiword-plugins-gnome.files 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugins-gnome.files 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -usr/lib/abiword-2.6/plugins/libAbiGOffice.* - diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugins.mime /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugins.mime --- abiword-2.6.2/debian/abiword-plugins.mime 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugins.mime 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ - diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugins.postinst /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugins.postinst --- abiword-2.6.2/debian/abiword-plugins.postinst 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugins.postinst 2008-07-18 04:24:35.000000000 +0100 @@ -0,0 +1,19 @@ +#!/bin/sh + +# Remove the diversions made by the old package. +if [ "$1" = configure ] && dpkg --compare-versions "$2" lt 2.6.4-4; then + for file in /usr/share/application-registry/abiword.applications \ + /usr/share/mime-info/abiword.keys \ + /usr/share/mime-info/abiword.mime \ + /usr/share/applications/abiword.desktop; do + dpkg-divert --package abiword-plugins --remove --rename --divert \ + $file.no-plugins $file + done + + # Rerun update-desktop-database to immediately register the desktop file. + if which update-desktop-database >/dev/null 2>&1 ; then + update-desktop-database -q + fi +fi + +#DEBHELPER# diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugins.postrm /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugins.postrm --- abiword-2.6.2/debian/abiword-plugins.postrm 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugins.postrm 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -#!/bin/sh - -if [ "$1" = remove ]; then - - for file in /usr/share/application-registry/abiword.applications /usr/share/mime-info/abiword.keys /usr/share/mime-info/abiword.mime /usr/share/applications/abiword.desktop; do - dpkg-divert --package abiword-plugins --remove --rename --divert \ - $file.no-plugins $file - done -fi - -#DEBHELPER# diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword-plugins.preinst /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword-plugins.preinst --- abiword-2.6.2/debian/abiword-plugins.preinst 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword-plugins.preinst 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -#!/bin/sh - -for file in /usr/share/application-registry/abiword.applications /usr/share/mime-info/abiword.keys /usr/share/mime-info/abiword.mime /usr/share/applications/abiword.desktop; do - dpkg-divert --package abiword-plugins --add --rename --divert \ - $file.no-plugins $file -done - -#DEBHELPER# diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword.postinst /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword.postinst --- abiword-2.6.2/debian/abiword.postinst 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword.postinst 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -#!/bin/sh - -#DEBHELPER# diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/abiword.preinst /tmp/qY2gb79Nml/abiword-2.6.4/debian/abiword.preinst --- abiword-2.6.2/debian/abiword.preinst 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/abiword.preinst 2008-07-18 04:24:35.000000000 +0100 @@ -17,16 +17,9 @@ case "$1" in install|upgrade) -# if [ "$1" = "upgrade" ] -# then -# start-stop-daemon --stop --quiet --oknodo \ -# --pidfile /var/run/dvipsk-ja.pid \ -# --exec /usr/sbin/dvipsk-ja 2>/dev/null || true -# fi - if [ -f /usr/bin/defoma-app ] ; then - defoma-app purge abiword > /dev/null || true - fi - + if [ -f /usr/bin/defoma-app ] ; then + defoma-app purge abiword > /dev/null || true + fi ;; abort-upgrade) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/changelog /tmp/qY2gb79Nml/abiword-2.6.4/debian/changelog --- abiword-2.6.2/debian/changelog 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/changelog 2008-07-18 04:24:35.000000000 +0100 @@ -1,18 +1,193 @@ -abiword (2.6.2-0ubuntu2+ppa3~gutsy2) gutsy; urgency=low +abiword (2.6.4-4ubuntu0+ppa3+gutsy2) gutsy; urgency=low - * Add back just libboost-dev build dep. + * Blindly downgrade debhelper version to 4 from 6 - -- Ryan Pavlik Sun, 27 Apr 2008 14:46:57 +0200 + -- Ryan Pavlik Thu, 17 Jul 2008 21:42:36 -0500 -abiword (2.6.2-0ubuntu2+ppa3~gutsy1) gutsy; urgency=low +abiword (2.6.4-4ubuntu0+ppa3+gutsy1) gutsy; urgency=low - * Backport latest Hardy package. + * Backport to Gutsy. + + -- Ryan Pavlik Thu, 17 Jul 2008 21:23:06 -0500 + +abiword (2.6.4-4ubuntu0+ppa3) hardy; urgency=medium + + * Rebuild in hopes that Launchpad will package /usr/share/ + + -- Ryan Pavlik Thu, 17 Jul 2008 20:05:23 -0500 + +abiword (2.6.4-4ubuntu0+ppa2) hardy; urgency=low + + * Manually add fix from joshk to update desktop database after + diversion fix. + + -- Ryan Pavlik Thu, 17 Jul 2008 16:46:51 -0500 + +abiword (2.6.4-4ubuntu0+ppa1) hardy; urgency=low + + * Port latest fixes from JoshK. + + -- Ryan Pavlik Thu, 17 Jul 2008 15:52:15 -0500 + +abiword (2.6.4-4) unstable; urgency=medium + + * The "Strike three, yer out!" release. + * Creating the dummy abiword-plugins package created yet another scenario + where we have to remove the diversions to the desktop files created by + the old packages. + + -- Joshua Kwan Thu, 17 Jul 2008 13:38:20 -0700 + +abiword (2.6.4-3ubuntu0+ppa4) hardy; urgency=medium + + * Take out that desktop file install line - it's redundant. + * Submit to build again - joshk says that missing files happens + when apt is goofed up, and this package builds on my own system + just fine. + + -- Ryan Pavlik Thu, 17 Jul 2008 14:00:33 -0500 + +abiword (2.6.4-3ubuntu0+ppa3) hardy; urgency=medium + + * Add back lost desktop file installation line to rules, removed + by joshk. + * Disable system goffice in main AbiWord build to use internal + version and avoid packaging mess. + + -- Ryan Pavlik Wed, 16 Jul 2008 15:58:26 -0500 + +abiword (2.6.4-3ubuntu0+ppa2) hardy; urgency=medium + + * Port tightening of upgrade provisions to account for 2.6.x (x<4) + packages with old-style abiword-plugins packages. + + -- Ryan Pavlik Tue, 15 Jul 2008 00:44:46 -0500 + +abiword (2.6.4-3ubuntu0+ppa1) hardy; urgency=medium + + * Port joshk's latest fixes to Ubuntu Hardy. + + -- Ryan Pavlik Mon, 14 Jul 2008 17:15:42 -0500 + +abiword (2.6.4-3) unstable; urgency=medium + + * The "Strike two" release. + * Creating the dummy abiword-plugins package created a scenario where + abiword-plugin-grammar would conflict filewise with the old + abiword-plugins package, so add a Conflicts for abiword-plugins (<< 2.6.4) + to the grammar and mathview plugin packages. + + -- Joshua Kwan Mon, 14 Jul 2008 17:29:27 -0700 + +abiword (2.6.4-1ubuntu0+ppa1+gutsy1) gutsy; urgency=low + + * Backport to Gutsy. + * Remove version number from boost package name. * Remove libasio-dev, libboost-date-time-dev, and libboost-regex-dev to disable TCP backend in Gutsy backport, where we don't have ASIO. - * Add libgoffice-0-dev since we have the right version in main on - Gutsy. - -- Ryan Pavlik Sun, 27 Apr 2008 12:33:57 +0200 + -- Ryan Pavlik Mon, 14 Jul 2008 14:45:05 -0500 + +abiword (2.6.4-1ubuntu0+ppa2) hardy; urgency=medium + + * Fix name of boost build package. + + -- Ryan Pavlik Mon, 14 Jul 2008 15:33:13 -0500 + +abiword (2.6.4-2) unstable; urgency=medium + + * I disabled the "auto-save by default" patch by mistake and kept + a "disable smooth scrolling by default" patch in that I decided + to drop at the last minute. Fix dumb mistake. + + -- Joshua Kwan Mon, 14 Jul 2008 12:02:50 -0700 + +abiword (2.6.4-1ubuntu0+ppa1) hardy; urgency=medium + + * The "Joshk is cool and hangs out with upstream" release. + * Based on Josh's refinement of my ubuntu package for Debian. + * Downgrade debhelper version. + * Downgrade boost version to 1.34.1 again. + + -- Ryan Pavlik Fri, 11 Jul 2008 23:24:45 -0500 + +abiword (2.6.4-1) unstable; urgency=medium + + * The "Please Ubuntu, take this package!" release. + * New upstream stable release, incorporating many build bits from Ryan + Pavlik. Thanks! (His Ubuntu changelogs follow this entry.) + closes: #473508, #488069 + * Using medium priority to try and beat the freeze given the NEW delay + that this package will incur. + + * Major changes: + - Split out the abiword-plugins and abiword-plugins-gnome package into + three individual plugin packages: + + Recommended: abiword-plugin-mathview, abiword-plugin-grammar + Suggested: abiword-plugin-goffice (due to GNOME dependencies) + + - The old abiword-plugins and abiword-plugins-gnome packages have been + obsoleted and abiword-plugins-gnome is now a Conflicts/Replaces in + abiword. Because abiword-plugins has been split into two packages, + though, there is a dummy abiword-plugins package to ease upgrades. + + - There is no more abiword-gnome package. We only ship the GTK2 version, + which does depend on GNOME-Print, but that does not rely on the usual + large set of GNOME UI libraries. + + - Many of the file import/export plugins formerly provided only by the + abiword-plugins package are now included in the base distribution to + provide the best out-of-box functionality for those who install only + the abiword package. This means that no matter what, the abiword package + now has ODF/OOXML support. + + * Minor changes: + - Drop psiconv support overall to alleviate dependency bloat/package spam, + at the risk of offending the one guy who still has a Psion 5. + - Upgrade to debhelper 7 and Policy 3.8.0. + - Drop one of Ryan's Ubuntu patches by building abiword-2.6.pc in the + configure stage of debian/rules. Lose autoconf/automake build dep. + - Upgrade boost build-dependency to 1.35 to quell some apt-get insanity + while pbuilder satisfies the Build-Depends. + + * Bug fixes from upstream: + - Print preview now matches onscreen layout more accurately. + closes: #336216 + - Font operations are all done using Pango now, so the XAP_UnixFont + crash should no longer occur. closes: #443048, #444957 + - Spellcheck button is no longer greyed out gratuitously. closes: #422520 + - "!!" and "??" in DejaVu Sans Mono seem to be correctly monospaced + now. closes: #470949 + - AbiWord can now import OpenWriter files without a MIME type. + closes: #376417 + - Build error affecting 2.4.6 was already fixed upstream, but thanks + to Peter Green for the patch and Lucas Nussbaum for the report. + closes: #490414 + + -- Joshua Kwan Mon, 14 Jul 2008 10:26:14 -0700 + +abiword (2.6.3-0ubuntu1+ppa2) hardy; urgency=low + + * Add dh_desktop to register MIME types. + * Update control for better upgrading. + + -- Ryan Pavlik Mon, 26 May 2008 14:41:28 -0500 + +abiword (2.6.3-0ubuntu1+ppa1) hardy; urgency=low + + * Fix FTBFS due to problem in 02_add_mimetypes_to_desktop.dpatch + + -- Ryan Pavlik Fri, 02 May 2008 18:51:01 +0200 + +abiword (2.6.3-0ubuntu1) hardy; urgency=low + + * Update to new upstream release. + * Remove debian/patches/50_backport_pre263.dpatch due to update. + * Remove debian/patches/20_disable_smooth_scrolling_default.dpatch + based on additional feedback on modern (Hardy-class) machines. + + -- Ryan Pavlik Thu, 01 May 2008 23:39:57 +0200 abiword (2.6.2-0ubuntu2+ppa3) hardy; urgency=low @@ -104,34 +279,24 @@ -- Ryan Pavlik Mon, 21 Apr 2008 18:53:02 +0200 -abiword (2.4.6-3ubuntu3) hardy; urgency=low - - * debian/control: update build-dep from libgoffice-0-5-dev to - libgoffice-0-6-dev to fix FTBFS (LP: #194443) +abiword (2.4.6-5) unstable; urgency=low - -- Andrea Colangelo Fri, 22 Feb 2008 22:03:47 +0100 + * Rebuilt with the new libots-1-0. + * Bumped to Standards-Version: 3.7.3. + * Fixed various lintian warnings. -abiword (2.4.6-3ubuntu2) hardy; urgency=low + -- Masayuki Hatta (mhatta) Sun, 09 Dec 2007 14:21:36 +0900 - * Disable the Psion functionality, psiconv is in universe. +abiword (2.4.6-4) unstable; urgency=low - -- Steve Kowalik Mon, 26 Nov 2007 18:15:49 +1100 - -abiword (2.4.6-3ubuntu1) hardy; urgency=low - - * Merge from Debian unstable. - * Remaining Ubuntu changes: - - Add poppler06-api patch that corrects calls for the new poppler API. - - Weave i18n magic in debian/rules. - - Add intltool to Build-Depends. - - Modify Maintainer field as per spec. - * Ubuntu changes dropped: - - debian/patches/15_poppler_API_change.dpatch: fix call to poppler - - debian/abiword-plugins-gnome.files: don't try to - abiword-common/usr/lib/AbiWord-2.4/plugins/libAbiGOChart.so, it's not - there. + * Sorted out dpatch names. + 0- : Debian specific + 20-: Translation related + 30-: Temporary build fixes. + * Rebuilt with libpoppler2, thanks Dmitry E. Oboukhov for build fix! + - closes: #452676 - -- Steve Kowalik Sat, 24 Nov 2007 21:52:39 +1100 + -- Masayuki Hatta (mhatta) Tue, 04 Dec 2007 16:23:30 +0900 abiword (2.4.6-3) unstable; urgency=low @@ -151,29 +316,6 @@ -- Andreas Barth Tue, 3 Jul 2007 18:20:08 +0000 -abiword (2.4.6-2ubuntu2) gutsy; urgency=low - - * Rebuild for the libpoppler1 -> libpopper2 transistion. - * Add poppler06-api patch that corrects calls for the new poppler API. - - -- Steve Kowalik Thu, 6 Sep 2007 15:42:28 +1000 - -abiword (2.4.6-2ubuntu1) gutsy; urgency=low - - * Resynchronized with Debian, remaining Ubuntu changes: - - debian/patches/15_poppler_API_change.dpatch: fix call to poppler - function. - - debian/control: - - Maintainer: Ubuntu Core Developers - - - libgoffice-1-dev -> libgoffice-0-dev. - - debian/rules, debian/control: i18n magic. - - debian/abiword-plugins-gnome.files: don't try to - abiword-common/usr/lib/AbiWord-2.4/plugins/libAbiGOChart.so, it's not - there. - - -- Daniel Holbach Fri, 18 May 2007 08:51:51 +0200 - abiword (2.4.6-2) unstable; urgency=low * Acknowledged NMU - closes: #403352 @@ -1754,4 +1896,3 @@ * Initial Release (canceled, see above). -- Darren Benham Tue, 16 Mar 1999 12:59:22 -0800 - diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/control /tmp/qY2gb79Nml/abiword-2.6.4/debian/control --- abiword-2.6.2/debian/control 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/control 2008-07-18 04:24:35.000000000 +0100 @@ -1,19 +1,34 @@ Source: abiword Section: gnome Priority: optional -Maintainer: Ubuntu Core Developers +Maintainer: Ryan Pavlik XSBC-Original-Maintainer: Masayuki Hatta (mhatta) Uploaders: Joshua Kwan -Build-Depends: debhelper (>> 4.0.0), dpatch, intltool, libaiksaurus-1.2-dev (>= 1.2.1+dev-0.12-1.1), libaiksaurusgtk-1.2-dev (>= 1.2.1+dev-0.12-1.1), libboost-dev (>= 1.33.1), libenchant-dev (>= 1.1.6-1), libfreetype6-dev, libfribidi-dev, libglade2-dev, libglib2.0-dev, libgnomeprintui2.2-dev, libgoffice-0-dev, libgsf-1-dev (>= 1.13.2), libgtk2.0-dev, libgtkmathview-dev (>= 0.7.5), liblink-grammar4-dev, libloudmouth1-dev, libots-dev, libpng12-dev, libpopt-dev, libreadline5-dev | libreadline-dev, librsvg2-dev (>= 2.9.5-5), libwmf-dev, libwpd8-dev (>= 0.8.3-2), libwpg-dev (>= 0.1.0), libwv-dev (>= 1.2) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 4), dpatch, libgoffice-0-dev, libaiksaurus-1.2-dev (>= 1.2.1+dev-0.12-1.1), libaiksaurusgtk-1.2-dev (>= 1.2.1+dev-0.12-1.1), libboost-dev (>= 1.33.1), libenchant-dev (>= 1.1.6), libfreetype6-dev, libfribidi-dev, libglade2-dev, libglib2.0-dev, libgnomeprintui2.2-dev, libgsf-1-dev (>= 1.13.2), libgtk2.0-dev, libgtkmathview-dev (>= 0.7.5), liblink-grammar4-dev, libloudmouth1-dev, libots-dev, libpng12-dev, libpopt-dev, libreadline5-dev | libreadline-dev, librsvg2-dev (>= 2.9.5-5), libwmf-dev, libwpd8-dev (>= 0.8.3-2), libwpg-dev (>= 0.1.0), libwv-dev (>= 1.2) +Standards-Version: 3.8.0 + +Package: abiword-common +Section: editors +Architecture: all +Depends: ${misc:Depends}, abiword (>= ${source:Version}) +Recommends: abiword-help, aspell-en | aspell-dictionary +Description: efficient, featureful word processor with collaboration -- common files + AbiWord is a full-featured, efficient word processing application. + It is suitable for a wide variety of word processing tasks, and + is extensible with a variety of plugins. + . + This package contains the common files that are used on all architectures + without modification. Package: abiword Section: editors Architecture: any -Depends: ${shlibs:Depends}, gsfonts -Conflicts: abiword-gtk, abiword-gnome, abiword-doc (<< 2.0.0), abiword-plugins (<< 1.1.3), xfonts-abi (<< 2.0.0), abiword-plugins (<< 2.6.0), abiword-plugins-gnome (<< 2.6.0), abiword-help (<< 2.6.0) -Replaces: abiword-common, abiword-gtk, abiword-gnome, abiword-doc (<< 2.0.0), xfonts-abi (<< 2.0.0), abiword-plugins (<< 2.6.0) -Recommends: abiword-plugins, abiword-help, aspell-en | aspell-dictionary, poppler-utils +Depends: ${shlibs:Depends}, abiword-common (>= ${source:Version}), gsfonts +Conflicts: abiword-gnome +Replaces: abiword-gnome +Provides: abiword-gnome +Recommends: abiword-plugin-grammar, abiword-plugin-mathview, abiword-help, aspell-en | aspell-dictionary, poppler-utils +Suggests: abiword-plugin-goffice Description: efficient, featureful word processor with collaboration AbiWord is a full-featured, efficient word processing application. It is suitable for a wide variety of word processing tasks, and @@ -24,40 +39,50 @@ includes tools plugins, offering live collaboration with AbiWord users on Linux and Windows (using TCP or Jabber/XMPP), web translation and dictionary support, and more. + . + Additional plugins that require significant amounts of extra software to + function are in the various abiword-plugin-* packages. -Package: abiword-plugins +Package: abiword-plugin-grammar Section: editors Architecture: any -Depends: ${shlibs:Depends}, abiword (>= 2.6.0) -Replaces: abiword-plugins-gnome (<< 2.6.0) -Suggests: gimp -Recommends: latex-xft-fonts -Description: plugins for AbiWord +Depends: ${shlibs:Depends}, abiword (= ${binary:Version}) +Conflicts: abiword-plugins (<< 2.6.4) +Description: grammar checking plugin for AbiWord AbiWord is a full-featured, efficient word processing application. It is suitable for a wide variety of word processing tasks, and is extensible with a variety of plugins. . - This package contains several plugins shipped with AbiWord. - - Grammar Checker - - Equation Editor - - WordPerfect Graphics (WPG) import - - Thesaurus - - PDF text import - - Text summarizer + This package contains an in-line grammar checking system for AbiWord + documents. -Package: abiword-plugins-gnome -Section: gnome +Package: abiword-plugin-mathview +Section: editors Architecture: any -Depends: ${shlibs:Depends}, abiword (>= 2.6.0) -Replaces: abiword-plugins (<< 2.0.10) -Conflicts: abiword-plugins (<< 2.0.10) -Description: plugins for AbiWord (with GNOME dependency) +Depends: ${shlibs:Depends}, abiword (= ${binary:Version}), latex-xft-fonts +Conflicts: abiword-plugins (<< 2.6.4) +Description: equation editor plugin for AbiWord AbiWord is a full-featured, efficient word processing application. It is suitable for a wide variety of word processing tasks, and is extensible with a variety of plugins. . - This package contains plugins to interoperate with other GNOME - applications. + This package contains an equation editing system for AbiWord + documents. + +Package: abiword-plugin-goffice +Section: editors +Architecture: any +Conflicts: abiword-plugins-gnome +Replaces: abiword-plugins-gnome +Provides: abiword-plugins-gnome +Depends: ${shlibs:Depends}, abiword (= ${binary:Version}) +Description: GOffice interaction plugin for AbiWord + AbiWord is a full-featured, efficient word processing application. + It is suitable for a wide variety of word processing tasks, and + is extensible with a variety of plugins. + . + This package contains an GOffice compatibility plugin for AbiWord + documents. Package: abiword-help Section: doc @@ -70,3 +95,17 @@ is extensible with a variety of plugins. . This package contains online help files (in HTML format) for AbiWord. + +Package: abiword-plugins +Section: editors +Architecture: all +Depends: abiword-plugin-mathview, abiword-plugin-grammar +Suggests: abiword-plugin-goffice +Description: transitional plugins package for AbiWord + AbiWord is a full-featured, efficient word processing application. + It is suitable for a wide variety of word processing tasks, and + is extensible with a variety of plugins. + . + This package contains nothing and only serves as a transitional + package to the new abiword-plugin-* packages by depending on them. + You can safely remove this package at any time. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/misc/AbiWord.applications.plugins /tmp/qY2gb79Nml/abiword-2.6.4/debian/misc/AbiWord.applications.plugins --- abiword-2.6.2/debian/misc/AbiWord.applications.plugins 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/misc/AbiWord.applications.plugins 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -abiword - requires_terminal=false - expects_uris=false - command=abiword - can_open_multiple_files=true - name=AbiWord Word Processor - mime_types=application/docbook+xml,application/msword,application/rtf,application/vnd.oasis.opendocument.text,application/vnd.palm,application/vnd.plain,application/vnd.stardivision.writer,application/vnd.sun.xml.writer,application/vnd.wordperfect,application/wordperfect5.1,application/wordperfect6,application/x-abiword,application/x-applix-word,application/xhtml+xml,application/x-kword,application/x-mif,application/x-mswrite,application/x-palm-database,application/x-t602,text/abiword,text/html,text/plain,text/richtext,text/rtf,text/vnd.wap.wml,text/x-abiword,text/x-xml-abiword diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/misc/AbiWord.keys.plugins /tmp/qY2gb79Nml/abiword-2.6.4/debian/misc/AbiWord.keys.plugins --- abiword-2.6.2/debian/misc/AbiWord.keys.plugins 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/misc/AbiWord.keys.plugins 1970-01-01 01:00:00.000000000 +0100 @@ -1,80 +0,0 @@ -application/docbook+xml: - ext=dbk - -application/msword: - ext=doc - -application/rtf: - ext=rtf - -application/vnd.oasis.opendocument.text: - ext=odt - -application/vnd.palm: - ext=prc pdb pqa oprc - -application/vnd.plain: - ext=txt - -application/vnd.stardivision.writer: - ext=sdw - -application/vnd.sun.xml.writer: - ext=sxw - -application/vnd.wordperfect: - ext=wpd - -application/wordperfect5.1: - ext=wp5 - -application/wordperfect6: - ext=wp6 - -application/x-abiword: - ext=abw - -application/x-applix-word: - ext=awd - -application/xhtml+xml: - ext=xhtml - -application/x-kword: - ext=kwd - -application/x-mif: - ext=mif - -application/x-mswrite: - ext=wri - -application/x-palm-database: - ext=pdb prc - -application/x-t602: - ext=602 - -text/abiword: - ext=abw - -text/html: - ext=html - -text/plain: - ext=txt - -text/richtext: - ext=rtf - -text/rtf: - ext=rtf - -text/vnd.wap.wml: - ext=wml - -text/x-abiword: - ext=abw - -text/x-xml-abiword: - ext=abw diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/misc/AbiWord.mime.plugins /tmp/qY2gb79Nml/abiword-2.6.4/debian/misc/AbiWord.mime.plugins --- abiword-2.6.2/debian/misc/AbiWord.mime.plugins 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/misc/AbiWord.mime.plugins 1970-01-01 01:00:00.000000000 +0100 @@ -1,109 +0,0 @@ -application/docbook+xml: - open=abiword %f - open=abiword %f - -application/msword: - open=abiword %f - open=abiword %f - -application/rtf: - open=abiword %f - open=abiword %f - -application/vnd.oasis.opendocument.text: - open=abiword %f - open=abiword %f - -application/vnd.palm: - open=abiword %f - open=abiword %f - -application/vnd.plain: - open=abiword %f - open=abiword %f - -application/vnd.stardivision.writer: - open=abiword %f - open=abiword %f - -application/vnd.sun.xml.writer: - open=abiword %f - open=abiword %f - -application/vnd.wordperfect: - open=abiword %f - open=abiword %f - -application/wordperfect5.1: - open=abiword %f - open=abiword %f - -application/wordperfect6: - open=abiword %f - open=abiword %f - -application/x-abiword: - open=abiword %f - open=abiword %f - -application/x-applix-word: - open=abiword %f - open=abiword %f - -application/xhtml+xml: - open=abiword %f - open=abiword %f - -application/x-kword: - open=abiword %f - open=abiword %f - -application/x-mif: - open=abiword %f - open=abiword %f - -application/x-mswrite: - open=abiword %f - open=abiword %f - -application/x-palm-database: - open=abiword %f - open=abiword %f - -application/x-t602: - open=abiword %f - open=abiword %f - -text/abiword: - open=abiword %f - open=abiword %f - -text/html: - open=abiword %f - open=abiword %f - -text/plain: - open=abiword %f - open=abiword %f - -text/richtext: - open=abiword %f - open=abiword %f - -text/rtf: - open=abiword %f - open=abiword %f - -text/vnd.wap.wml: - open=abiword %f - open=abiword %f - -text/x-abiword: - open=abiword %f - open=abiword %f - -text/x-xml-abiword: - open=abiword %f - open=abiword %f - - diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/patches/00list /tmp/qY2gb79Nml/abiword-2.6.4/debian/patches/00list --- abiword-2.6.2/debian/patches/00list 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/patches/00list 2008-07-18 04:24:35.000000000 +0100 @@ -1,6 +1,4 @@ 02_add_mimetypes_to_desktop -03_modify_extras_pkgconfig +#03_nosmoothscroll_default - don't want this right now. 04_autosave_default 14_comma_subscript -20_disable_smooth_scrolling_default -50_backport_pre263 diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/patches/02_add_mimetypes_to_desktop.dpatch /tmp/qY2gb79Nml/abiword-2.6.4/debian/patches/02_add_mimetypes_to_desktop.dpatch --- abiword-2.6.2/debian/patches/02_add_mimetypes_to_desktop.dpatch 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/patches/02_add_mimetypes_to_desktop.dpatch 2008-07-18 04:24:35.000000000 +0100 @@ -6,12 +6,11 @@ ## DP: by the plugins we package. @DPATCH@ -diff -urNad abiword-2.6.2~/abiword/abiword.desktop abiword-2.6.2/abiword/abiword.desktop ---- abiword-2.6.2~/abiword/abiword.desktop 2008-04-07 18:58:58.000000000 +0200 -+++ abiword-2.6.2/abiword/abiword.desktop 2008-04-07 22:15:08.000000000 +0200 -@@ -3,13 +3,13 @@ - Encoding=UTF-8 - Name=AbiWord +diff -urNad abiword-2.6.3~/abiword/abiword.desktop abiword-2.6.3/abiword/abiword.desktop +--- abiword-2.6.3~/abiword/abiword.desktop 2008-05-02 18:29:09.000000000 +0200 ++++ abiword-2.6.3/abiword/abiword.desktop 2008-05-02 18:35:54.000000000 +0200 +@@ -1,13 +1,13 @@ + [Desktop Entry] Exec=abiword -Icon=abiword_48 +Icon=abiword @@ -19,9 +18,10 @@ Type=Application Categories=Application;Office;WordProcessor;GNOME;GTK;X-Red-Hat-Base; StartupNotify=true + Encoding=UTF-8 X-Desktop-File-Install-Version=0.9 -MimeType=application/x-abiword;text/x-abiword;text/x-xml-abiword;text/plain;application/msword;application/rtf;application/vnd.plain;application/xhtml+xml;text/html;application/x-crossmark;application/docbook+xml;application/x-t602;application/vnd.oasis.opendocument.text;application/vnd.sun.xml.writer;application/vnd.stardivision.writer;text/vnd.wap.wml;application/wordperfect6;application/wordperfect5.1; +MimeType=application/docbook+xml;application/msword;application/rtf;application/vnd.oasis.opendocument.text;application/vnd.palm;application/vnd.plain;application/vnd.stardivision.writer;application/vnd.sun.xml.writer;application/vnd.wordperfect;application/wordperfect5.1;application/wordperfect6;application/x-abiword;application/x-applix-word;application/xhtml+xml;application/x-kword;application/x-mif;application/x-mswrite;application/x-palm-database;application/x-t602;text/abiword;text/html;text/plain;text/richtext;text/rtf;text/vnd.wap.wml;text/x-abiword;text/x-xml-abiword; + Name=AbiWord GenericName=Word Processor Comment=AbiWord Word Processor - Name[de]=Textverarbeitung diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/patches/03_modify_extras_pkgconfig.dpatch /tmp/qY2gb79Nml/abiword-2.6.4/debian/patches/03_modify_extras_pkgconfig.dpatch --- abiword-2.6.2/debian/patches/03_modify_extras_pkgconfig.dpatch 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/patches/03_modify_extras_pkgconfig.dpatch 1970-01-01 01:00:00.000000000 +0100 @@ -1,20 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 03_modify_extras_pkgconfig.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Fix the pkg-config name sought by abiword-extras when compiling against -## DP: a non-installed abiword. - -@DPATCH@ -diff -urNad abiword-2.6.2~/abiword-extras/configure.ac abiword-2.6.2/abiword-extras/configure.ac ---- abiword-2.6.2~/abiword-extras/configure.ac 2008-04-06 23:23:51.000000000 +0200 -+++ abiword-2.6.2/abiword-extras/configure.ac 2008-04-07 15:54:49.000000000 +0200 -@@ -6,7 +6,7 @@ - AC_C_BIGENDIAN - AM_CONDITIONAL(BIGENDIAN,[ test "x$ac_cv_c_bigendian" = "xyes" ]) - --abi_pkg='abiword-2.6' -+abi_pkg='abiword' - PKG_CHECK_MODULES([ABIWORD_EXTRAS_DEPS], [ "$abi_pkg" ], [ - ABIWORD_EXTRAS_PKGDATADIR=`$PKG_CONFIG --variable=pkgdatadir $abi_pkg` - ]) diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/patches/03_nosmoothscroll_default.dpatch /tmp/qY2gb79Nml/abiword-2.6.4/debian/patches/03_nosmoothscroll_default.dpatch --- abiword-2.6.2/debian/patches/03_nosmoothscroll_default.dpatch 1970-01-01 01:00:00.000000000 +0100 +++ abiword-2.6.4/debian/patches/03_nosmoothscroll_default.dpatch 2008-07-18 04:24:35.000000000 +0100 @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03_nosmoothscroll_default.dpatch by Joshua Kwan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +--- abiword-2.6.3/abiword/src/af/xap/xp/xap_Prefs_SchemeIds.h~ 2008-07-11 14:15:15.000000000 +0300 ++++ abiword-2.6.3/abiword/src/af/xap/xp/xap_Prefs_SchemeIds.h 2008-07-11 14:15:28.000000000 +0300 +@@ -139,7 +139,7 @@ + #define XAP_PREF_DEFAULT_AllowCustomToolbars "0" + + #define XAP_PREF_KEY_EnableSmoothScrolling "EnableSmoothScrolling" +-#define XAP_PREF_DEFAULT_EnableSmoothScrolling "1" ++#define XAP_PREF_DEFAULT_EnableSmoothScrolling "0" + + #define XAP_PREF_KEY_HaveCustomToolbars "HaveCustomToolbars" + #define XAP_PREF_DEFAULT_HaveCustomToolbars "0" diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/patches/20_disable_smooth_scrolling_default.dpatch /tmp/qY2gb79Nml/abiword-2.6.4/debian/patches/20_disable_smooth_scrolling_default.dpatch --- abiword-2.6.2/debian/patches/20_disable_smooth_scrolling_default.dpatch 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/patches/20_disable_smooth_scrolling_default.dpatch 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 20_disable_smooth_scrolling_default.dpatch by Ryan Pavlik -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: For improved responsiveness disable smooth scrolling by default - -@DPATCH@ -diff -urNad abiword-2.6.2~/abiword/src/af/xap/xp/xap_Prefs_SchemeIds.h abiword-2.6.2/abiword/src/af/xap/xp/xap_Prefs_SchemeIds.h ---- abiword-2.6.2~/abiword/src/af/xap/xp/xap_Prefs_SchemeIds.h 2008-04-06 17:59:55.000000000 +0200 -+++ abiword-2.6.2/abiword/src/af/xap/xp/xap_Prefs_SchemeIds.h 2008-04-27 03:24:11.000000000 +0200 -@@ -139,7 +139,7 @@ - #define XAP_PREF_DEFAULT_AllowCustomToolbars "0" - - #define XAP_PREF_KEY_EnableSmoothScrolling "EnableSmoothScrolling" --#define XAP_PREF_DEFAULT_EnableSmoothScrolling "1" -+#define XAP_PREF_DEFAULT_EnableSmoothScrolling "0" - - #define XAP_PREF_KEY_HaveCustomToolbars "HaveCustomToolbars" - #define XAP_PREF_DEFAULT_HaveCustomToolbars "0" diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/patches/50_backport_pre263.dpatch /tmp/qY2gb79Nml/abiword-2.6.4/debian/patches/50_backport_pre263.dpatch --- abiword-2.6.2/debian/patches/50_backport_pre263.dpatch 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/patches/50_backport_pre263.dpatch 1970-01-01 01:00:00.000000000 +0100 @@ -1,19788 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 50_backport_pre263.dpatch by Ryan Pavlik -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Remove this patch when we use a 2.6.3 upstream. -## DP: Patches backported from SVN for reliability/crasher fixes. -## DP: - r23441_fix_html_toc_export.diff -## DP: - r23443_escape_style_names_in_css.diff -## DP: - r23446_fix_language_code_de_CH_template.diff -## DP: - r23451_prevent_footnote_endnote_crashes.diff -## DP: - r23453_fix_rtf_transparent_handler.diff -## DP: - r23477_dont_use_deprecated_libxml2_apis.diff -## DP: - r23481_fix_spelling_menu_crash.diff -## DP: - r23482_fix_related_crashes.diff -## DP: - r23526_fix_crash_on_import_crafted_odt.diff - -@DPATCH@ -diff -urNad abiword-2.6.2~/abiword/src/af/util/xp/ut_xml_libxml2.cpp abiword-2.6.2/abiword/src/af/util/xp/ut_xml_libxml2.cpp ---- abiword-2.6.2~/abiword/src/af/util/xp/ut_xml_libxml2.cpp 2008-04-17 13:12:33.000000000 +0200 -+++ abiword-2.6.2/abiword/src/af/util/xp/ut_xml_libxml2.cpp 2008-04-17 21:45:40.000000000 +0200 -@@ -207,7 +207,7 @@ - { - if(getNumMinorErrors() > getNumRecoveredErrors()) - { -- UT_DEBUGMSG (("Error - 1 parsing '%s' (Line: %d, Column: %d)\n", szFilename, getLineNumber(ctxt), getColumnNumber(ctxt))); -+ UT_DEBUGMSG (("Error - 1 parsing '%s' (Line: %d, Column: %d)\n", szFilename, xmlSAX2GetLineNumber(ctxt), xmlSAX2GetColumnNumber(ctxt))); - ret = UT_IE_IMPORTERROR; - break; - } -@@ -218,7 +218,7 @@ - { - if (xmlParseChunk (ctxt, "", 0, 1)) - { -- UT_DEBUGMSG (("Error -2 parsing '%s' (Line: %d, Column: %d)\n", szFilename, getLineNumber(ctxt), getColumnNumber(ctxt))); -+ UT_DEBUGMSG (("Error -2 parsing '%s' (Line: %d, Column: %d)\n", szFilename, xmlSAX2GetLineNumber(ctxt), xmlSAX2GetColumnNumber(ctxt))); - ret = UT_IE_IMPORTERROR; - } - } -diff -urNad abiword-2.6.2~/abiword/src/text/fmt/xp/fp_Run.cpp abiword-2.6.2/abiword/src/text/fmt/xp/fp_Run.cpp ---- abiword-2.6.2~/abiword/src/text/fmt/xp/fp_Run.cpp 2008-04-17 13:12:32.000000000 +0200 -+++ abiword-2.6.2/abiword/src/text/fmt/xp/fp_Run.cpp 2008-04-17 21:45:40.000000000 +0200 -@@ -4809,10 +4809,16 @@ - fp_FieldFootnoteRefRun::fp_FieldFootnoteRefRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) - { - const PP_AttrProp * pp = getSpanAP(); -+ UT_return_if_fail(pp); -+ - const gchar * footid; - bool bRes = pp->getAttribute("footnote-id", footid); - -- UT_ASSERT(bRes); -+ if(!bRes || !footid) -+ { -+ UT_DEBUGMSG(("fp_FieldFootnoteRefRun::fp_FieldFootnoteRefRun: Missing footnote-id attribute. Probably a malformed file.\n")); -+ return; -+ } - m_iPID = atol(footid); - - // see bug 9793 -@@ -4830,9 +4836,9 @@ - const gchar * footid = NULL; - bool bRes = pp->getAttribute("footnote-id", footid); - -- UT_ASSERT(bRes); -- if(!bRes) -+ if(!bRes || !footid) - { -+ UT_DEBUGMSG(("fp_FieldFootnoteRefRun::calculateValue: Missing footnote-id attribute. Probably a malformed file.\n")); - return false; - } - FV_View * pView = _getView(); -@@ -4858,10 +4864,16 @@ - fp_FieldFootnoteAnchorRun::fp_FieldFootnoteAnchorRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) - { - const PP_AttrProp * pp = getSpanAP(); -- const gchar * footid; -+ UT_return_if_fail(pp); -+ -+ const gchar * footid = NULL; - bool bRes = pp->getAttribute("footnote-id", footid); - -- UT_ASSERT(bRes); -+ if(!bRes || !footid) -+ { -+ UT_DEBUGMSG(("fp_FieldFootnoteAnchorRun::fp_FieldFootnoteAnchorRun: Missing footnote-id attribute. Probably a malformed file.\n")); -+ return; -+ } - m_iPID = atol(footid); - - // see bug 9793 -@@ -4872,12 +4884,14 @@ - bool fp_FieldFootnoteAnchorRun::calculateValue(void) - { - const PP_AttrProp * pp = getSpanAP(); -+ UT_return_val_if_fail(pp, false); -+ - const gchar * footid = NULL; - bool bRes = pp->getAttribute("footnote-id", footid); - -- UT_ASSERT(bRes); -- if(footid == NULL) -+ if(!bRes || !footid) - { -+ UT_DEBUGMSG(("fp_FieldFootnoteAnchorRun::calculateValue: Missing footnote-id attribute. Probably a malformed file.\n")); - return false; - } - UT_uint32 iPID = atoi(footid); -@@ -4900,10 +4914,16 @@ - fp_FieldEndnoteAnchorRun::fp_FieldEndnoteAnchorRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) - { - const PP_AttrProp * pp = getSpanAP(); -- const gchar * footid; -+ UT_return_if_fail(pp); -+ -+ const gchar * footid = NULL; - bool bRes = pp->getAttribute("endnote-id", footid); - -- UT_ASSERT(bRes); -+ if(!bRes || !footid) -+ { -+ UT_DEBUGMSG(("fp_FieldEndnoteAnchorRun::fp_FieldEndnoteAnchorRun: Missing endnote-id attribute. Probably a malformed file.\n")); -+ return; -+ } - m_iPID = atoi(footid); - - // see bug 9793 -@@ -4913,14 +4933,15 @@ - // Appears in the EndnoteSection, one per endnote. - bool fp_FieldEndnoteAnchorRun::calculateValue(void) - { -- - const PP_AttrProp * pp = getSpanAP(); -+ UT_return_val_if_fail(pp, false); -+ - const gchar * footid = NULL; - bool bRes = pp->getAttribute("endnote-id", footid); - -- UT_ASSERT(bRes); -- if(footid == NULL) -+ if(!bRes || !footid) - { -+ UT_DEBUGMSG(("fp_FieldEndnoteAnchorRun::calculateValue: Missing endnote-id attribute. Probably a malformed file.\n")); - return false; - } - UT_uint32 iPID = atoi(footid); -@@ -4943,10 +4964,16 @@ - fp_FieldEndnoteRefRun::fp_FieldEndnoteRefRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) - { - const PP_AttrProp * pp = getSpanAP(); -+ UT_return_if_fail(pp); -+ - const gchar * footid; - bool bRes = pp->getAttribute("endnote-id", footid); - -- UT_ASSERT(bRes); -+ if(!bRes || !footid) -+ { -+ UT_DEBUGMSG(("fp_FieldEndnoteRefRun::fp_FieldEndnoteRefRun: Missing endnote-id attribute. Probably a malformed file.\n")); -+ return; -+ } - m_iPID = atoi(footid); - - // see bug 9793 -@@ -4956,14 +4983,15 @@ - // Appears in the EndnoteSection, one per endnote. - bool fp_FieldEndnoteRefRun::calculateValue(void) - { -- - const PP_AttrProp * pp = getSpanAP(); -+ UT_return_val_if_fail(pp, false); -+ - const gchar * footid = NULL; - bool bRes = pp->getAttribute("endnote-id", footid); - -- UT_ASSERT(bRes); -- if(footid == NULL) -+ if(!bRes || !footid) - { -+ UT_DEBUGMSG(("fp_FieldEndnoteRefRun::calculateValue: Missing endnote-id attribute. Probably a malformed file.\n")); - return false; - } - UT_uint32 iPID = atoi(footid); -@@ -5045,7 +5073,7 @@ - char szFieldValue[FPFIELD_MAX_LENGTH + 1]; - - PD_Document * pDoc = getBlock()->getDocument(); -- UT_ASSERT(pDoc); -+ UT_return_val_if_fail(pDoc, false); - - //copy in the name or some wierd char instead - const char * name = pDoc->getFilename(); -diff -urNad abiword-2.6.2~/abiword/src/text/fmt/xp/fp_Run.cpp.orig abiword-2.6.2/abiword/src/text/fmt/xp/fp_Run.cpp.orig ---- abiword-2.6.2~/abiword/src/text/fmt/xp/fp_Run.cpp.orig 1970-01-01 01:00:00.000000000 +0100 -+++ abiword-2.6.2/abiword/src/text/fmt/xp/fp_Run.cpp.orig 2008-04-17 21:45:40.000000000 +0200 -@@ -0,0 +1,5820 @@ -+/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ -+ -+/* AbiWord -+ * Copyright (C) 1998 AbiSource, Inc. -+ * Copyright (c) 2001,2002 Tomas Frydrych -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version 2 -+ * of the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -+ * 02111-1307, USA. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+ -+#include "fp_Run.h" -+#include "fp_TextRun.h" -+#include "fl_DocLayout.h" -+#include "fl_BlockLayout.h" -+#include "fp_Line.h" -+ -+#include "fp_Column.h" -+#include "fp_Page.h" -+#include "pp_Property.h" -+#include "gr_Graphics.h" -+#include "pd_Document.h" -+#include "gr_DrawArgs.h" -+#include "pp_AttrProp.h" -+#include "fd_Field.h" -+#include "po_Bookmark.h" -+#include "ut_debugmsg.h" -+#include "ut_assert.h" -+#include "ut_string.h" -+#include "ut_growbuf.h" -+#include "fp_TableContainer.h" -+#include "fl_TableLayout.h" -+#include "fl_FootnoteLayout.h" -+#include "fp_FootnoteContainer.h" -+#include "fl_AutoNum.h" -+#include "fv_View.h" -+#include "fl_TOCLayout.h" -+#include "ap_Prefs.h" -+#include "ap_Strings.h" -+#include "xap_Frame.h" -+#include "gr_Painter.h" -+ -+#include "ut_sleep.h" -+ -+// define this if you want fp_Run::lookupProperties() to dump props and attr belonging to -+// this run. NB this has a very adverse effect on performance, so it should be turned off -+// before committing -+//#define FPRUN_PROPS_MINI_DUMP -+ -+#ifdef _MSC_VER -+// MSVC++ warns about using 'this' in initializer list. -+#pragma warning(disable: 4355) -+#endif -+ -+// TODO can we use the indexAP provided in the change records -+// TODO to remember the attr/prop for each run rather than -+// TODO looking it up each time we call lookupProperties() -- jeff 4/19/99 -+ -+ -+// findPointCoords: -+// Can be called to find the position and size of the point (cursor) -+// for an offset both before, inside and after the Run. -+// Before: When the Run is the first on a Line and point is a BOL. -+// Inside: When the point is inside the Run. -+// After : Point is at the start of the next Run, but insertion is -+// done with the properties of this Run so cursor size/position -+// must reflect that. -+// -+// Previous implementations would assert that the offset was within the -+// Run, but that would always fail for the 'After' case. -+ -+/*****************************************************************/ -+ -+/* -+ TODO this file is too long -- it needs to be broken -+ up into several pieces. -+*/ -+ -+fp_Run::fp_Run(fl_BlockLayout* pBL, -+ UT_uint32 iOffsetFirst, -+ UT_uint32 iLen, -+ FP_RUN_TYPE iType) : -+ fp_ContainerObject(FP_CONTAINER_RUN, pBL->getSectionLayout()), -+ m_iType (iType), -+ m_pLine(0), -+ m_pBL(pBL), -+ m_pNext(0), -+ m_pPrev(0), -+ m_iX(0), -+ m_iOldX(0), -+ m_iY(0), -+ m_iWidth(0), -+ m_iHeight(0), -+ m_iAscent(0), -+ m_iDescent(0), -+ m_iOffsetFirst(iOffsetFirst), -+ m_iLen(iLen), -+ m_bDirty(true), // a run which has just been created is not onscreen, therefore it is dirty -+ m_pField(0), -+ m_iDirection(UT_BIDI_WS), //by default all runs are whitespace -+ m_iVisDirection(UT_BIDI_UNSET), -+ m_eRefreshDrawBuffer(GRSR_Unknown), // everything -+ m_pColorHL(255,255,255,true), // set highlight colour to transparent -+ m_pFont(0), -+ m_bRecalcWidth(false), -+ m_fDecorations(0), -+ m_iLineWidth(0), -+ m_iLinethickness(0), -+ m_iUnderlineXoff(0), -+ m_imaxUnderline(0), -+ m_iminOverline(0), -+ m_iOverlineXoff(0), -+ m_pHyperlink(0), -+ m_pRevisions(NULL), -+ m_eVisibility(FP_VISIBLE), -+ m_bIsCleared(true), -+ m_FillType(NULL,static_cast(this),FG_FILL_TRANSPARENT), -+ m_bPrinting(false), -+ m_pG(NULL), -+ m_iTmpX(0), -+ m_iTmpY(0), -+ m_iTmpWidth(0), -+ m_pTmpLine(NULL), -+ m_bDrawSelection(false), -+ m_iSelLow(0), -+ m_iSelHigh(0), -+ m_bMustClearScreen(false) -+#ifdef DEBUG -+ ,m_iFontAllocNo(0) -+#endif -+{ -+ xxx_UT_DEBUGMSG(("fp_Run %x created!!! \n",this)); -+ pBL->setPrevListLabel(false); -+ m_FillType.setDocLayout(m_pBL->getDocLayout()); -+} -+ -+fp_Run::~fp_Run() -+{ -+ // no impl. -+ xxx_UT_DEBUGMSG(("~fp_Run %x deleted!!! \n",this)); -+ -+// Zero these to trap mem errors. -+#if 1 -+ m_pPrev = NULL; -+ m_pNext = NULL; -+ m_pBL = NULL; -+ m_pLine = NULL; -+#endif -+ -+ DELETEP(m_pRevisions); -+} -+ -+UT_sint32 fp_Run::getHeight() const -+{ -+ if(isHidden() == FP_VISIBLE) -+ { -+ return m_iHeight; -+ } -+ return 0; -+} -+ -+UT_sint32 fp_Run::getWidth() const -+{ -+ if(isHidden() == FP_VISIBLE) -+ return m_iWidth; -+ -+ return 0; -+} -+ -+UT_uint32 fp_Run::getAscent() const -+{ -+ if(isHidden() == FP_VISIBLE) -+ { -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ if(getGraphics() && pLayout->isQuickPrint() && getGraphics()->queryProperties(GR_Graphics::DGP_PAPER) && (getType() != FPRUN_IMAGE) && (getType() != FPRUN_TEXT)&& (getType() != FPRUN_FIELD)) -+ { -+ return static_cast(static_cast(m_iAscent)*getGraphics()->getResolutionRatio()); -+ } -+ return m_iAscent; -+ } -+ return 0; -+} -+ -+UT_uint32 fp_Run::getDescent() const -+{ -+ if(isHidden() == FP_VISIBLE) -+ { -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ if(getGraphics() && pLayout->isQuickPrint() && getGraphics()->queryProperties(GR_Graphics::DGP_PAPER)) -+ { -+ return static_cast(static_cast(m_iDescent)*getGraphics()->getResolutionRatio()); -+ } -+ return m_iDescent; -+ } -+ -+ return 0; -+} -+ -+UT_sint32 fp_Run::getDrawingWidth() const -+{ -+ if(isHidden() == FP_VISIBLE) -+ return static_cast(m_iWidth); -+ -+ return 0; -+} -+ -+ -+fg_FillType * fp_Run::getFillType(void) -+{ -+ return &m_FillType; -+} -+ -+bool fp_Run::isInSelectedTOC(void) -+{ -+ if(getBlock()->isContainedByTOC()) -+ { -+ fl_TOCLayout * pTOCL = static_cast(getBlock()->myContainingLayout()); -+ return pTOCL->isSelected(); -+ } -+ else -+ { -+ return false; -+ } -+ -+} -+ -+/*! -+ * The following are methods to avoid flickering while changing a selection. -+ * The idea is to generate a cliprect around just the selected text. -+ */ -+ -+/*! -+ * Set the selection draw mode. -+ */ -+void fp_Run::setSelectionMode(PT_DocPosition posLow, PT_DocPosition posHigh) -+{ -+ m_bDrawSelection = true; -+ m_iSelLow = posLow; -+ m_iSelHigh = posHigh; -+} -+ -+/*! -+ * Clear the selection mode -+ */ -+void fp_Run::clearSelectionMode(void) -+{ -+ m_bDrawSelection = false; -+ m_iSelLow = 0; -+ m_iSelHigh = 0; -+} -+ -+bool fp_Run::isSelectionDraw(void) const -+{ -+ return m_bDrawSelection; -+} -+ -+PT_DocPosition fp_Run::posSelLow(void) const -+{ -+ return m_iSelLow; -+} -+ -+PT_DocPosition fp_Run::posSelHigh(void) const -+{ -+ return m_iSelHigh; -+} -+/*! -+ * This method looks at the values of TmpX and TmpWidth and compares them -+ * to the new ones. If they're different we do a clearscreen on them. -+ */ -+bool fp_Run::clearIfNeeded(void) -+{ -+ // only do this on runs that have not been cleared already -+ // see bug 8154 -+ if(m_bIsCleared &&!getMustClearScreen() ) -+ return true; -+ -+ // if((getTmpX() == getX()) && (getTmpWidth() == getWidth()) && (getTmpY() == getY())) -+ if((getTmpX() == getX()) && (getTmpY() == getY()) && (getTmpLine() == getLine()) && !getMustClearScreen() ) -+ { -+ return true; -+ } -+ if(getTmpLine() && (getLine() != getTmpLine())) -+ { -+ fp_Line * pTmpLine = getTmpLine(); -+ UT_sint32 i = getBlock()->findLineInBlock(pTmpLine); -+ if(i < 0) -+ { -+ markWidthDirty(); -+ return false; -+ } -+ fp_Run * pLastRun = pTmpLine->getLastRun(); -+ pTmpLine->clearScreenFromRunToEnd(pLastRun); -+ markWidthDirty(); -+ return false; -+ } -+ UT_sint32 iWidth = getWidth(); -+ UT_sint32 iX = getX(); -+ UT_sint32 iY = getY(); -+ _setWidth(getTmpWidth()); -+ // -+ // Special case of merging the first char into the first run of -+ // block -+ // -+ if(getMustClearScreen() && (getTmpWidth() == 0) && (getX() == getTmpX())) -+ _setWidth(iWidth); -+ _setX(getTmpX()); -+ _setY(getTmpY()); -+ // -+ // If a run was created by "split" it initially has X value zero. Don't -+ // reset the "clear" in this. -+ // -+ // If the run was just newly inserted (and is, therefore, not on screen) do not reset -+ // its clear flag -+ // -+ if(getTmpX() != 0 && getTmpWidth() != 0) -+ { -+ m_bIsCleared = false; -+ } -+ clearScreen(); -+ markWidthDirty(); -+ _setX(iX); -+ _setWidth(iWidth); -+ _setY(iY); -+ return false; -+} -+void fp_Run::Fill(GR_Graphics * pG, UT_sint32 x, UT_sint32 y, UT_sint32 width, -+ UT_sint32 height) -+{ -+ xxx_UT_DEBUGMSG(("-------------------Fill called!!!!---- x %d width %d \n",x,width)); -+ if((width < 1) || (height < 1)) -+ { -+ return; -+ } -+ UT_sint32 srcX = 0; -+ UT_sint32 srcY = 0; -+ fp_Line * pLine = getLine(); -+ UT_sint32 xoff=0,yoff=0; -+ if(pLine) -+ { -+ pLine->getScreenOffsets(this,xoff,yoff); -+ fp_Page * pPage = pLine->getPage(); -+ srcX = x - xoff; -+ if(pPage) -+ { -+ pPage->expandDamageRect(xoff+getX()+srcX,yoff+getY(),width,height); -+ } -+ } -+ bool bDoGrey = (pG->queryProperties(GR_Graphics::DGP_SCREEN) && -+ ((getType() == FPRUN_FIELD) || getBlock()->isContainedByTOC())); -+ if(bDoGrey && isInSelectedTOC()) -+ { -+ bDoGrey = false; -+ } -+ if(!bDoGrey) -+ { -+ m_FillType.Fill(pG,srcX,srcY,x,y,width,height); -+ } -+ else -+ { -+ if(x>=xoff && width <= getWidth()) -+ { -+ UT_RGBColor grey(192,192,192); -+ // UT_RGBColor white(255,255,255); -+ GR_Painter painter(pG); -+ // painter.fillRect(white,x,y,width,height); -+ painter.fillRect(grey,x,y,width,height); -+ } -+ else -+ { -+ m_FillType.Fill(pG,srcX,srcY,x,y,width,height); -+ } -+ } -+} -+ -+void fp_Run::lookupProperties(GR_Graphics * pG) -+{ -+ const PP_AttrProp * pSpanAP = NULL; -+ const PP_AttrProp * pBlockAP = NULL; -+ const PP_AttrProp * pSectionAP = NULL; // TODO do we care about section-level inheritance? -+ bool bGraphicsNull = false; -+ getBlockAP(pBlockAP); -+ -+ PD_Document * pDoc = m_pBL->getDocument(); -+ -+#ifdef FPRUN_PROPS_MINI_DUMP -+ UT_DEBUGMSG(("fp_Run::lookupProperties: dumping block AP\n")); -+ if(pBlockAP) -+ pBlockAP->miniDump(pDoc); -+#endif -+ // examining the m_pRevisions contents is too involved, it is -+ // faster to delete it and create a new instance if needed -+ if(m_pRevisions) -+ { -+ delete m_pRevisions; -+ m_pRevisions = NULL; -+ } -+ -+ setVisibility(FP_VISIBLE); // set default visibility -+ -+ // NB the call will recreate m_pRevisions for us and it will -+ // change visibility if it is affected by the presence of revisions -+ if(!getBlock()->isContainedByTOC()) -+ { -+ getSpanAP(pSpanAP); -+ } -+ else -+ { -+ pSpanAP = pBlockAP; -+ } -+ xxx_UT_DEBUGMSG(("fp_Run: pSpanAP %x \n",pSpanAP)); -+ -+#ifdef FPRUN_PROPS_MINI_DUMP -+ UT_DEBUGMSG(("fp_Run::lookupProperties: dumping span AP\n")); -+ if(pSpanAP) -+ pSpanAP->miniDump(pDoc); -+#endif -+ -+ //evaluate the "display" property and superimpose it over anything -+ //we got as the result of revisions -+ const gchar *pszDisplay = PP_evalProperty("display",pSpanAP,pBlockAP, -+ pSectionAP, pDoc, true); -+ -+ if(pszDisplay && !strcmp(pszDisplay,"none")) -+ { -+ if(m_eVisibility == FP_VISIBLE) -+ setVisibility(FP_HIDDEN_TEXT); -+ else -+ setVisibility(FP_HIDDEN_REVISION_AND_TEXT); -+ } -+ -+ // here we handle background colour -- we parse the property into -+ // m_pColorHL and then call updateHighlightColor() to overlay any -+ // colour from higher layout elements -+ const char * pszBGcolor = PP_evalProperty("bgcolor",pSpanAP,pBlockAP,pSectionAP, pDoc, true); -+ _setColorHL(pszBGcolor); -+ // m_FillType.setColor(pszBGcolor); // we should clear with screen color -+ // and draw with background color -+ if(pG == NULL) -+ { -+ m_bPrinting = false; -+ pG = getGraphics(); -+ bGraphicsNull = true; -+ } -+ else if(pG->queryProperties(GR_Graphics::DGP_PAPER)) -+ { -+ m_bPrinting = true; -+ m_pG = pG; -+ } -+ if(!m_pBL->isContainedByTOC()) -+ { -+ if(bGraphicsNull) -+ _lookupProperties(pSpanAP, pBlockAP, pSectionAP,NULL); -+ else -+ _lookupProperties(pSpanAP, pBlockAP, pSectionAP,pG); -+ } -+ else -+ { -+ if(bGraphicsNull) -+ _lookupProperties(NULL, pBlockAP, pSectionAP,NULL); -+ else -+ _lookupProperties(NULL, pBlockAP, pSectionAP,pG); -+ } -+ -+ // here we used to set revision-based visibility, but that has to -+ // be done inside getSpanAP() because we need to know whether the -+ // revision is to be visible or not before we can properly apply -+ // any properties the revision contains. -+ -+} -+#undef FPRUN_PROPS_MINI_DUMP -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+/* -+ Determine best split point in Run -+ \param iMaxLeftWidth Width to split at -+ \retval si Split information (left width, right width, and position) -+ \param bForce Force a split at first opportunity (max width) -+ \return True if split point was found in this Run, otherwise false. -+ -+ This implementation simply returns false, forcing line breaker to -+ look for a split point in previous Runs. -+*/ -+bool fp_Run::findMaxLeftFitSplitPoint(UT_sint32 /* iMaxLeftWidth */, -+ fp_RunSplitInfo& /* si */, -+ bool /* bForce */) -+{ -+ return false; -+} -+ -+bool fp_Run::hasLayoutProperties(void) const -+{ -+ return false; -+} -+ -+/*! -+ Find previous Run in block which holds property information -+ \return Run with property information or NULL -+*/ -+fp_Run* -+fp_Run::_findPrevPropertyRun(void) const -+{ -+ fp_Run* pRun = getPrevRun(); -+ while (pRun && (!pRun->hasLayoutProperties() || pRun->isHidden() || (pRun->getType() == FPRUN_IMAGE))) -+ pRun = pRun->getPrevRun(); -+ if(pRun == NULL) -+ { -+ pRun = getPrevRun(); -+ while (pRun && (!pRun->hasLayoutProperties() || pRun->isHidden())) -+ pRun = pRun->getPrevRun(); -+ -+ } -+ return pRun; -+} -+ -+/*! -+ Inherit attribute properties from previous Run -+ -+ This is used by Runs for which it does not make sense to have -+ properties, such as forced line breaks end EOP Runs. -+*/ -+void -+fp_Run::_inheritProperties(void) -+{ -+ if(m_pG == NULL) -+ { -+ m_pG = getGraphics(); -+ } -+ fp_Run* pRun = _findPrevPropertyRun(); -+ if (pRun) -+ { -+ xxx_UT_DEBUGMSG(("fp_Run::_inheritProperties: from prev run\n")); -+ _setAscent(pRun->getAscent()); -+ _setDescent(pRun->getDescent()); -+ _setHeight(pRun->getHeight()); -+ xxx_UT_DEBUGMSG(("fp_Run::_inheritProperties: from prev run height is %d \n",getHeight())); -+ -+ } -+ else -+ { -+ // look for fonts in this DocLayout's font cache -+ //UT_DEBUGMSG(("fp_Run::_inheritProperties: from current font\n")); -+ const PP_AttrProp * pSpanAP = NULL; -+ const PP_AttrProp * pBlockAP = NULL; -+ const PP_AttrProp * pSectionAP = NULL; // TODO do we care about section-level inheritance? -+ -+ //m_pBL->getSpanAttrProp(getBlockOffset(),true,&pSpanAP); -+ getSpanAP(pSpanAP); -+ getBlockAP(pBlockAP); -+ -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ const GR_Font * pFont = pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,m_pG); -+ -+ if ((pFont != _getFont()) || (getType() == FPRUN_ENDOFPARAGRAPH)) -+ { -+ _setFont(pFont); -+ _setAscent(getGraphics()->getFontAscent(pFont)); -+ _setDescent(getGraphics()->getFontDescent(pFont)); -+ _setHeight(getGraphics()->getFontHeight(pFont)); -+ } -+ xxx_UT_DEBUGMSG(("fp_Run::_inheritProperties: No prev run run height is %d \n",getHeight())); -+ } -+} -+ -+GR_Graphics * fp_Run::getGraphics(void) const -+{ -+ if(m_bPrinting) -+ { -+ return m_pG; -+ } -+ else -+ { -+ return getBlock()->getDocLayout()->getGraphics(); -+ } -+} -+ -+void fp_Run::insertIntoRunListBeforeThis(fp_Run& newRun) -+{ -+ newRun.unlinkFromRunList(); -+ newRun.setNextRun(this); -+ if (m_pPrev) -+ { -+ m_pPrev->setNextRun(&newRun); -+ if(newRun.getType()!= FPRUN_HYPERLINK) -+ newRun.setHyperlink( m_pPrev->getHyperlink()); -+ } -+ newRun.setPrevRun(m_pPrev); -+ setPrevRun(&newRun); -+ -+} -+ -+void fp_Run::insertIntoRunListAfterThis(fp_Run& newRun) -+{ -+ newRun.unlinkFromRunList(); -+ newRun.setPrevRun(this); -+ if(newRun.getType()!= FPRUN_HYPERLINK) -+ newRun.setHyperlink(m_pHyperlink); -+ if (m_pNext) -+ { -+ m_pNext->setPrevRun(&newRun); -+ } -+ newRun.setNextRun(m_pNext); -+ setNextRun(&newRun); -+} -+ -+void fp_Run::unlinkFromRunList() -+{ -+ //first if this is the start of a hyperlink run, -+ //remove the references to it from the following runs -+ if(getType() == FPRUN_HYPERLINK) -+ { -+ fp_HyperlinkRun * pH = static_cast(this); -+ if(pH->isStartOfHyperlink()) -+ { -+ fp_Run * pRun = getNextRun(); -+ -+ while(pRun && pRun->getHyperlink() == pH) -+ { -+ pRun->setHyperlink(NULL); -+ pRun = pRun->getNextRun(); -+ } -+ } -+ } -+ -+ if (m_pPrev) -+ { -+ m_pPrev->setNextRun(m_pNext); -+ } -+ if (m_pNext) -+ { -+ m_pNext->setPrevRun(m_pPrev); -+ setNextRun(0); -+ } -+ setPrevRun(0); -+} -+ -+void fp_Run::setHyperlink(fp_HyperlinkRun * pH) -+{ -+ if(pH != m_pHyperlink) -+ { -+ _setHyperlink(pH); -+ clearScreen(); -+ } -+} -+ -+/*! returns PP_AttrProp associated with this span, taking on board the -+ presence of revisions -+ \returns pSpan : location to store the PP_AttrProp -+*/ -+const PP_AttrProp * fp_Run::getSpanAP(void) -+{ -+ const PP_AttrProp * pAP = NULL; -+ getSpanAP(pAP); -+ return pAP; -+} -+ -+/*! returns PP_AttrProp associated with this span, taking on board the -+ presence of revisions -+ \param pSpan : location to store the PP_AttrProp -+*/ -+void fp_Run::getSpanAP(const PP_AttrProp * &pSpanAP) -+{ -+ if(getBlock()->isContainedByTOC()) -+ { -+ getBlockAP(pSpanAP); -+ return; -+ } -+ -+ //first we need to ascertain if this revision is visible -+ FV_View* pView = _getView(); -+ UT_return_if_fail(pView); -+ -+ UT_uint32 iId = pView->getRevisionLevel(); -+ bool bShow = pView->isShowRevisions(); -+ bool bHiddenRevision = false; -+ -+ if(getType() != FPRUN_FMTMARK && getType() != FPRUN_DUMMY && getType() != FPRUN_DIRECTIONMARKER) -+ { -+ getBlock()->getSpanAttrProp(getBlockOffset(),false,&pSpanAP,&m_pRevisions,bShow,iId,bHiddenRevision); -+ } -+ else -+ { -+ getBlock()->getSpanAttrProp(getBlockOffset(),true,&pSpanAP,&m_pRevisions,bShow,iId,bHiddenRevision); -+ } -+ if(pSpanAP == NULL) -+ { -+ // FIXME for now lets work around this -+ // UT_ASSERT(UT_SHOULD_NOT_HAPPEN); track these down later. -+ // -+ getBlockAP(pSpanAP); -+ return; -+ } -+ if(bHiddenRevision) -+ { -+ setVisibility(FP_HIDDEN_REVISION); -+ } -+ else -+ { -+ setVisibility(FP_VISIBLE); -+ } -+} -+ -+void fp_Run::setX(UT_sint32 iX, bool bDontClearIfNeeded) -+{ -+ Run_setX(iX, FP_CLEARSCREEN_AUTO); -+} -+ -+// the parameter eClearScreen has a default value AUTO -+// we need this extra parameter be able to specify false when calling from -+// inside of the first pass of fp_Line::layout(), which sets -+// only a temporary value of iX which is then adjusted in the -+// second pass, without this the run will redraw twice, once always unnecessarily -+// and most of the time both times unnecessarily -+void fp_Run::Run_setX(UT_sint32 iX, FPRUN_CLEAR_SCREEN eClearScreen) -+{ -+ switch(eClearScreen) -+ { -+ case FP_CLEARSCREEN_AUTO: -+ if (iX == m_iX) -+ { -+ return; -+ } -+ //otherwise fall through -+ case FP_CLEARSCREEN_FORCE: -+ m_iX = m_iOldX; -+ clearScreen(); -+ m_iOldX = iX; -+ m_iX = iX; -+ break; -+ case FP_CLEARSCREEN_NEVER: -+ // only set m_iX and leave m_iOldX alone; this allows for -+ // multiple calls to setX with the NEVER parameter without -+ // intervening FORCE or AUTO -+ m_iX = iX; -+ break; -+ default: -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ } -+ -+} -+ -+void fp_Run::setY(UT_sint32 iY) -+{ -+ if (iY == m_iY) -+ { -+ return; -+ } -+ -+ clearScreen(); -+ -+ m_iY = iY; -+} -+ -+void fp_Run::setLine(fp_Line* pLine) -+{ -+ if (pLine == m_pLine) -+ { -+ return; -+ } -+ clearScreen(); -+ -+ m_pLine = pLine; -+ if(pLine != NULL) -+ { -+ m_FillType.setParent(pLine->getFillType()); -+ } -+ else -+ { -+ m_FillType.setParent(NULL); -+ } -+} -+ -+ -+/* -+ In the BIDI build, changing runs next or previous can result in -+ change of visual appearance of the run or a run immediately adjucent -+ (say deleting last character of a word may require that the new -+ last character is displayed using a final-form glyph which). -+ Consequently we need to mark the width and draw buffer as dirty, -+ and that is what happens when the bRefresh is true (which is the -+ default value). However, the refresh is very expensive, and sometimes -+ we know that it is not needed (e.g. simply merging neigbouring runs -+ does not change context, merely the way we store the stuff) -- in that -+ case we specify bRefresh false -+ -+*/ -+ -+void fp_Run::setNextRun(fp_Run* p, bool bRefresh) -+{ -+ if(p != m_pNext) -+ { -+ // change of context, need to refresh draw buffer if context sensitive -+ if(bRefresh) -+ orDrawBufferDirty(GRSR_ContextSensitive); -+ -+ //m_bRecalcWidth |= bRefresh; -- will be taken care of when -+ //buffer is recalculated -+#if 0 -+ // we do not do ligatures across run boundaries any more, -+ // Tomas, Nov 15, 2003 -+ // because we support 2-char ligatures, the change of next -+ // can also influence the run ahead of us -+ // we will just mark it -+ if(m_pPrev && bRefresh) -+ { -+ m_pPrev->markDrawBufferDirty(); -+ m_pPrev->markWidthDirty(); -+ } -+#endif -+ m_pNext = p; -+ } -+} -+ -+void fp_Run::setPrevRun(fp_Run* p, bool bRefresh) -+{ -+ if(p != m_pPrev) -+ { -+ // change of context, need to refresh draw buffer if context sensitive -+ if(bRefresh) -+ orDrawBufferDirty(GRSR_ContextSensitive); -+ -+ // m_bRecalcWidth |= bRefresh; -- will be taken care of when -+ // buffer is recacluated -+#if 0 -+ // we do not do ligatures across run boundaries any more, -+ // Tomas, Nov 15, 2003 -+ // because we support 2-char ligatures, the change of prev -+ // can also influence the run that follows us -+ // we will just mark it -+ if(m_pNext && bRefresh) -+ { -+ m_pNext->markDrawBufferDirty(); -+ m_pNext->markWidthDirty(); -+ } -+#endif -+ m_pPrev = p; -+ } -+} -+ -+bool fp_Run::isLastRunOnLine(void) const -+{ -+ return (getLine()->getLastRun() == this); -+} -+ -+bool fp_Run::isFirstRunOnLine(void) const -+{ -+ return (getLine()->getFirstRun() == this); -+} -+ -+bool fp_Run::isLastVisRunOnLine(void) const -+{ -+ return (getLine()->getLastVisRun() == this); -+} -+ -+bool fp_Run::isFirstVisRunOnLine(void) const -+{ -+ return (getLine()->getFirstVisRun() == this); -+} -+ -+void fp_Run::markAsDirty(void) -+{ -+ xxx_UT_DEBUGMSG(("Run %x marked dirty \n")); -+ m_bDirty = true; -+} -+ -+ -+/*! -+ * return an rectangle that covers this object on the screen -+ * The calling routine is resposible for deleting the returned struct -+ */ -+UT_Rect * fp_Run::getScreenRect(void) -+{ -+ UT_sint32 xoff = 0; -+ UT_sint32 yoff = 0; -+ UT_Rect * pRec = NULL; -+ fp_Line * pLine = getLine(); -+ if(pLine) -+ { -+ pLine->getScreenOffsets(this,xoff,yoff); -+ pRec= new UT_Rect(xoff,yoff,getWidth(),getHeight()); -+ return pRec; -+ } -+ else -+ { -+ return NULL; -+ } -+} -+ -+/*! -+ * Marks Dirty any runs that overlap the supplied rectangle. This rectangle -+ * is relative to the screen. -+ */ -+void fp_Run::markDirtyOverlappingRuns(UT_Rect & recScreen) -+{ -+ UT_Rect * pRec = NULL; -+ pRec = getScreenRect(); -+ if(pRec && recScreen.intersectsRect(pRec)) -+ { -+ fp_Run::markAsDirty(); -+ delete pRec; -+ return; -+ } -+ DELETEP(pRec); -+ return; -+} -+ -+void fp_Run::setCleared(void) -+{ -+ m_bIsCleared = true; -+} -+ -+bool fp_Run::isOnlyRunOnLine(void) const -+{ -+ if (getLine()->countRuns() == 1) -+ { -+ UT_ASSERT(isFirstRunOnLine()); -+ UT_ASSERT(isLastRunOnLine()); -+ -+ return true; -+ } -+ -+ return false; -+} -+ -+void fp_Run::setLength(UT_uint32 iLen, bool bRefresh) -+{ -+ if (iLen == getLength()) -+ { -+ return; -+ } -+ m_bRecalcWidth |= bRefresh; -+ if(getWidth() > 0) -+ clearScreen(); -+ // UT_ASSERT((getType() == FPRUN_FMTMARK) || (iLen > 0)); -+ m_iLen = iLen; -+ -+ // change of length generally means something got deleted, and -+ // that affects all text in the present run, and shaping in the -+ // runs adjacent -+ if(bRefresh) -+ { -+ orDrawBufferDirty(GRSR_Unknown); -+ -+ if(m_pPrev) -+ { -+ m_pPrev->orDrawBufferDirty(GRSR_ContextSensitive); -+ } -+ -+ if(m_pNext) -+ { -+ m_pNext->orDrawBufferDirty(GRSR_ContextSensitive); -+ } -+ } -+} -+ -+void fp_Run::setBlockOffset(UT_uint32 offset) -+{ -+ m_iOffsetFirst = offset; -+} -+ -+void fp_Run::clearScreen(void) -+{ -+ Run_ClearScreen(false); -+} -+ -+void fp_Run::Run_ClearScreen(bool bFullLineHeightRect) -+{ -+ if(!getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)) -+ { -+ return; -+ } -+ markAsDirty(); -+ if (m_bIsCleared && !getMustClearScreen()) -+ { -+ // no need to clear if we've already done so. -+ return; -+ } -+ m_bMustClearScreen = false; -+ -+ if (!getLine()) -+ { -+ // nothing to clear if this run is not currently on a line -+ return; -+ } -+ xxx_UT_DEBUGMSG(("SEVIOR: Doing Run_ClearScreen in run %x \n",this)); -+ if(getLine()->getContainer() != NULL) -+ { -+ if(getLine()->getContainer()->getPage() != 0) -+ { -+ UT_Rect clip(0,0,0,0); -+ if(isSelectionDraw()) -+ { -+ if(getType() == FPRUN_TEXT) -+ { -+ bool bRTL = (getVisDirection() == UT_BIDI_RTL); -+ -+ UT_sint32 xoff,yoff; -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ UT_sint32 xLeft = xoff; -+ UT_sint32 xRight = xLeft + getWidth(); -+ UT_sint32 x1,y1,x2,y2,height; -+ bool bDir; -+ if(posSelLow() > getBlock()->getPosition(true) + getBlockOffset()) -+ { -+ findPointCoords(posSelLow() - getBlock()->getPosition(true), x1,y1,x2,y2,height,bDir); -+ -+ if(bRTL) //rtl needs translation -+ { -+ xRight = x1 + _getView()->getPageViewLeftMargin(); -+ xRight -= _getView()->getXScrollOffset(); -+ } -+ else -+ { -+ xLeft = x1 + _getView()->getPageViewLeftMargin(); -+ xLeft -= _getView()->getXScrollOffset(); -+ } -+ -+ } -+ if(posSelHigh() < getBlock()->getPosition(true) + getBlockOffset() + getLength()) -+ { -+ findPointCoords(posSelHigh() - getBlock()->getPosition(true) +1, x1,y1,x2,y2,height,bDir); -+ if(bRTL) //rtl needs translation -+ { -+ xLeft = x1 + _getView()->getPageViewLeftMargin();; -+ xLeft -= _getView()->getXScrollOffset(); -+ } -+ else -+ { -+ xRight = x1 + _getView()->getPageViewLeftMargin();; -+ xRight -= _getView()->getXScrollOffset(); -+ } -+ } -+ clip.set(xLeft,yoff,xRight-xLeft,getLine()->getHeight()); -+ getGraphics()->setClipRect(&clip); -+ } -+ } -+ _clearScreen(bFullLineHeightRect); -+ if(isSelectionDraw()) -+ { -+ getGraphics()->setClipRect(NULL); -+ } -+ // make sure we only get erased once -+ _setDirty(true); -+ m_bIsCleared = true; -+ } -+ else -+ { -+ xxx_UT_DEBUGMSG(("fp_Run: Clearscreen on line without page \n")); -+ } -+ } -+ else -+ { -+ xxx_UT_DEBUGMSG(("fpRun: Clearscreen on line without container \n")); -+ } -+ fp_Line * pLine = getLine(); -+ if(pLine) -+ { -+ pLine->setNeedsRedraw(); -+ } -+ -+ xxx_UT_DEBUGMSG(("fp_Run: clearscreen applied \n")); -+} -+ -+static UT_RGBColor s_fgColor; -+ -+const UT_RGBColor fp_Run::getFGColor(void) const -+{ -+ // revision colours -+ FV_View * pView = _getView(); -+ UT_return_val_if_fail(pView, s_fgColor); -+ bool bShow = pView->isShowRevisions(); -+ -+ if(m_pRevisions && bShow) -+ { -+ bool bMark = pView->isMarkRevisions(); -+ const PP_Revision * r = m_pRevisions->getLastRevision(); -+ -+ UT_return_val_if_fail(r != NULL, _getColorFG()); -+ -+ bool bRevColor = false; -+ -+ if(!bMark) -+ { -+ // this is the case when we are in non-marking mode ... -+ bRevColor = true; -+ } -+ -+ UT_uint32 iId = r->getId(); -+ UT_uint32 iShowId = pView->getRevisionLevel(); -+ -+ if(bMark && iShowId == 0) -+ { -+ // this is the case where we are in marking mode and are -+ // supposed to reveal all -+ bRevColor = true; -+ } -+ -+ if(bMark && iShowId != 0 && (iId-1 == iShowId)) -+ { -+ // this is the case when we are in marking mode, and are -+ // supposed to reveal id > iShowId -+ bRevColor = true; -+ } -+ -+ if(!bRevColor) -+ return _getColorFG(); -+ -+ s_fgColor = _getView()->getColorRevisions(iId-1); -+ } -+ else if(m_pHyperlink && getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)) -+ { -+ s_fgColor = _getView()->getColorHyperLink(); -+ } -+ else -+ return _getColorFG(); -+ -+ return s_fgColor; -+} -+ -+void fp_Run::_setFont(const GR_Font * f) -+{ -+ m_pFont = f; -+ -+#ifdef DEBUG -+ if(f) -+ m_iFontAllocNo = f->getAllocNumber(); -+#endif -+} -+ -+const GR_Font * fp_Run::_getFont(void) const -+{ -+#ifdef DEBUG -+ if(m_pFont) -+ { -+ // if this assert fails we are in deep trouble; basically, the font pointer points -+ // to some other font that it was when it was set -+ UT_ASSERT_HARMLESS( m_iFontAllocNo == m_pFont->getAllocNumber()); -+ } -+#endif -+ -+ return m_pFont; -+} -+ -+void fp_Run::_setDirty(bool b) -+{ -+ xxx_UT_DEBUGMSG(("fp_Run:: run %x Dirty state set to %d \n",this,b)); -+ m_bDirty = b; -+} -+ -+void fp_Run::draw(dg_DrawArgs* pDA) -+{ -+ if (pDA->bDirtyRunsOnly && !m_bDirty) -+ { -+ xxx_UT_DEBUGMSG(("fp_Run::Run %x not dirty returning \n",this)); -+ return; -+ } -+ -+ if(isHidden()) -+ { -+ // this run is marked as hidden, nothing to do -+ return; -+ } -+ -+ m_bIsCleared = false; -+ fp_Line * pLine = getLine(); -+ if (pLine) -+ pLine->setScreenCleared(false); -+ -+ //UT_usleep(100000); // 0.1 seconds useful for debugging -+ xxx_UT_DEBUGMSG(("SEVIOR: draw Run this %x line %x \n",this, getLine())); -+ GR_Graphics * pG = pDA->pG; -+ // shortcircuit drawing if we're way off base. -+ long imax = (1 << 15) - 1; -+ if (((pDA->yoff < -imax) || (pDA->yoff > imax)) && pG->queryProperties(GR_Graphics::DGP_SCREEN)) -+ return; -+ -+ if(pG->queryProperties(GR_Graphics::DGP_PAPER)) -+ { -+ m_bPrinting = true; -+ m_pG = pG; -+ lookupProperties(pG); -+ } -+ pG->setColor(getFGColor()); -+ UT_Rect clip(0,0,0,0); -+ if(isSelectionDraw()) -+ { -+ if((getType() == FPRUN_TEXT) && getLine()) -+ { -+ bool bRTL = (getVisDirection() == UT_BIDI_RTL); -+ UT_sint32 xLeft = pDA->xoff; -+ UT_sint32 xRight = xLeft + getWidth(); -+ UT_sint32 x1,y1,x2,y2,height; -+ bool bDir; -+ -+ if(posSelLow() > getBlock()->getPosition(true) + getBlockOffset()) -+ { -+ findPointCoords(posSelLow() - getBlock()->getPosition(true), x1,y1,x2,y2,height,bDir); -+ if(bRTL) -+ { -+ xRight = x1 + _getView()->getPageViewLeftMargin(); -+ xRight -= _getView()->getXScrollOffset(); -+ } -+ else -+ { -+ xLeft = x1 + _getView()->getPageViewLeftMargin(); -+ xLeft -= _getView()->getXScrollOffset(); -+ } -+ } -+ if(posSelHigh() < getBlock()->getPosition(true) + getBlockOffset() + getLength()) -+ { -+ findPointCoords(posSelHigh() - getBlock()->getPosition(true) +1, x1,y1,x2,y2,height,bDir); -+ if(bRTL) -+ { -+ xLeft = x1 + _getView()->getPageViewLeftMargin(); -+ xLeft -= _getView()->getXScrollOffset(); -+ } -+ else -+ { -+ xRight = x1 + _getView()->getPageViewLeftMargin(); -+ xRight -= _getView()->getXScrollOffset(); -+ } -+ } -+ UT_sint32 width = xRight-xLeft; -+ clip.set(xLeft,pDA->yoff-getLine()->getAscent(),width,getLine()->getHeight()); -+ pDA->pG->setClipRect(&clip); -+ } -+ } -+ UT_RGBColor OldCol = *m_FillType.getColor(); -+ UT_RGBColor bgCol = _getColorHL(); -+ xxx_UT_DEBUGMSG((" bg red %d rg blue %d bg green %d trans %d \n",bgCol.m_red,bgCol.m_blu,bgCol.m_grn,bgCol.m_bIsTransparent)); -+ if(!bgCol.isTransparent()) -+ { -+ m_FillType.setColor(bgCol); -+ } -+ UT_DEBUGMSG(("Drawing pDA->yoff %d \n",pDA->yoff)); -+ _draw(pDA); -+ if(!bgCol.isTransparent()) -+ { -+ m_FillType.setColor(OldCol); // restore the old clear color -+ } -+ if(isSelectionDraw()) -+ { -+ pDA->pG->setClipRect(NULL); -+ } -+ FV_View* pView = _getView(); -+ UT_return_if_fail(pView); -+ bool bShowRevs = pView->isShowRevisions(); -+ -+ UT_uint32 i2Du = pDA->pG->tlu(1); // changed this to 1 to fix various pixel dirt -+ -+ if(m_pRevisions && bShowRevs) -+ { -+ GR_Painter painter(pG); -+ const PP_Revision * r = m_pRevisions->getLastRevision(); -+ UT_ASSERT(r != NULL); -+ -+ if (r) { -+ PP_RevisionType r_type = r->getType(); -+ UT_uint32 iId = r->getId(); -+ UT_uint32 iShowId = pView->getRevisionLevel(); -+ bool bMark = pView->isMarkRevisions(); -+ -+ if(bMark && iShowId != 0) -+ iId--; -+ -+ if(!bMark || !iShowId || iId == iShowId) -+ { -+ pG->setColor(getFGColor()); -+ -+ UT_uint32 iWidth = getDrawingWidth(); -+ -+ if(r_type == PP_REVISION_ADDITION || r_type == PP_REVISION_ADDITION_AND_FMT) -+ { -+ painter.fillRect(s_fgColor,pDA->xoff, pDA->yoff + i2Du, iWidth, getGraphics()->tlu(1)); -+ painter.fillRect(s_fgColor,pDA->xoff, pDA->yoff + i2Du + getGraphics()->tlu(2), -+ iWidth, getGraphics()->tlu(1)); -+ -+ } -+ else if(r_type == PP_REVISION_FMT_CHANGE) -+ { -+ // draw a thick line underneath -+ painter.fillRect(s_fgColor,pDA->xoff, pDA->yoff + i2Du, iWidth, getGraphics()->tlu(2)); -+ } -+ else -+ { -+ // draw a strike-through line -+ -+ painter.fillRect(s_fgColor,pDA->xoff, pDA->yoff - m_iHeight/3, -+ iWidth, getGraphics()->tlu(2)); -+ } -+ } -+ } -+ } -+ -+ if(m_pHyperlink && pG->queryProperties(GR_Graphics::DGP_SCREEN)) -+ { -+ // have to set the colour again, since fp_TextRun::_draw can set it to red -+ // for drawing sguiggles -+ GR_Painter painter(pG); -+ pG->setColor(_getView()->getColorHyperLink()); -+ pG->setLineProperties(pG->tluD(1.0), -+ GR_Graphics::JOIN_MITER, -+ GR_Graphics::CAP_PROJECTING, -+ GR_Graphics::LINE_SOLID); -+ -+ painter.drawLine(pDA->xoff, pDA->yoff + i2Du, pDA->xoff + m_iWidth, pDA->yoff + i2Du); -+ } -+ -+ if(m_eVisibility == FP_HIDDEN_TEXT || m_eVisibility == FP_HIDDEN_REVISION_AND_TEXT) -+ { -+ GR_Painter painter(pG); -+ pG->setColor(getFGColor()); -+ pG->setLineProperties(pG->tluD(1.0), -+ GR_Graphics::JOIN_MITER, -+ GR_Graphics::CAP_PROJECTING, -+ GR_Graphics::LINE_DOTTED); -+ -+ painter.drawLine(pDA->xoff, pDA->yoff + i2Du, pDA->xoff + m_iWidth, pDA->yoff + i2Du); -+ -+ } -+ m_bIsCleared = false; -+ _setDirty(false); -+ if(pG->queryProperties(GR_Graphics::DGP_PAPER)) -+ { -+ m_bPrinting = false; -+ m_pG = NULL; -+ lookupProperties(NULL); -+ } -+} -+ -+/*! -+ Determines if run is currently visible or hidden -+ run is hidden in the following circumstances: -+ -+ a) it is formatted as hidden and show para is off -+ -+ b) it is part of a revision that makes it hidden; several cases -+ fall into this category, but that is immaterial here (the -+ decision on this is made in lookupProperties() -+bool fp_Run::isHidden() const -+*/ -+ -+/*! -+ Determines if run would be hidden if its visibility was set to the -+ given value eVisibility -+*/ -+bool fp_Run::_wouldBeHidden(FPVisibility eVisibility) const -+{ -+ FV_View* pView = _getView(); -+ bool bShowHidden = pView->getShowPara(); -+ -+ bool bHidden = ((eVisibility == FP_HIDDEN_TEXT && !bShowHidden) -+ || eVisibility == FP_HIDDEN_REVISION -+ || eVisibility == FP_HIDDEN_REVISION_AND_TEXT); -+ -+ return bHidden; -+} -+ -+/*! -+ changes the visibility of the present run; this requires -+ invalidating different things depending on circumstances -+*/ -+void fp_Run::setVisibility(FPVisibility eVis) -+{ -+ if(m_eVisibility == eVis) -+ return; -+ -+ if(eVis == FP_HIDDEN_TEXT && !_wouldBeHidden(eVis) && m_iWidth == 0) -+ { -+ // we are asked to mark text as hidden, and under the present settings it would be -+ // visible, but its width == 0. While the 0 width could be legitimate, it is more -+ // likely that the run was previously hidden due to ShowPara == false and now is -+ // being shown -- we need to make sure everything gets updated -+ // (this case avoids the logic below, because of the way that lookupProperties() -+ // works -- it might be worth redesigning that -+ m_bIsCleared = true; -+ m_bDirty = true; -+ m_bRecalcWidth = true; -+ m_eVisibility = eVis; -+ return; -+ } -+ -+ if( (isHidden() && _wouldBeHidden(eVis)) -+ || (!isHidden() && !_wouldBeHidden(eVis))) -+ { -+ // this run will remain as it is, so we just set visibility to -+ // the new value -+ m_eVisibility = eVis; -+ return; -+ } -+ -+ if(_wouldBeHidden(eVis)) -+ { -+ // we are going into hiding, so we need to clear screen first -+ clearScreen(); -+ -+ // we do not need to redraw -+ m_bDirty = false; -+ m_bRecalcWidth = true; -+ m_eVisibility = eVis; -+ return; -+ } -+ -+ // we are unhiding: need to mark everything dirty -+ m_bIsCleared = true; -+ m_bDirty = true; -+ m_bRecalcWidth = true; -+ m_eVisibility = eVis; -+ -+ /* recalculate width immediately so that any calls to getWidth() are -+ * accurate -+ */ -+ _recalcWidth(); -+ -+ return; -+} -+ -+bool fp_Run::deleteFollowingIfAtInsPoint() const -+{ -+ if(isHidden()) -+ return true; -+ else -+ return _deleteFollowingIfAtInsPoint(); -+} -+ -+bool fp_Run::_deleteFollowingIfAtInsPoint() const -+{ -+ return false; -+} -+ -+ -+bool fp_Run::canContainPoint(void) const -+{ -+ if(isHidden()) -+ return false; -+ else -+ return _canContainPoint(); -+} -+ -+bool fp_Run::_canContainPoint(void) const -+{ -+ return true; -+} -+ -+bool fp_Run::letPointPass(void) const -+{ -+ if(isHidden()) -+ return true; -+ else -+ return _letPointPass(); -+} -+ -+bool fp_Run::_letPointPass(void) const -+{ -+ return true; -+} -+ -+bool fp_Run::recalcWidth(void) -+{ -+ if(isHidden()) -+ { -+ if(m_iWidth != 0) -+ { -+ m_iWidth = 0; -+ return true; -+ } -+ -+ return false; -+ } -+ else -+ return _recalcWidth(); -+} -+ -+/*! -+ update ascent, decent and height -+*/ -+void fp_Run::updateVerticalMetric() -+{ -+ if(m_pFont) -+ { -+ _setAscent(getGraphics()->getFontAscent(m_pFont)); -+ _setDescent(getGraphics()->getFontDescent(m_pFont)); -+ _setHeight(getGraphics()->getFontHeight(m_pFont)); -+ } -+} -+ -+ -+bool fp_Run::_recalcWidth(void) -+{ -+ // do nothing. subclasses may override this. -+ return false; -+} -+ -+void fp_Run::drawDecors(UT_sint32 xoff, UT_sint32 yoff, GR_Graphics * pG) -+{ -+ UT_DEBUGMSG(("drawDecors xoff %d \n",xoff)); -+ /* -+ Upon entry to this function, yoff is the TOP of the run, -+ NOT the baseline. -+ */ -+ -+ /* -+ Here is the code to work out the position and thickness of under -+ and overlines for a run of text. This is neccessary because an -+ underline or overline could shift position depending on the -+ text size - particularly for subscripts and superscripts. We -+ can't work out where to put the lines until the end of the -+ lined span. This info is saved in the fp_Run class. If a -+ underline or overline is pending (because the next run -+ continues the underline or overline), mark the next run as -+ dirty to make sure it is drawn. -+ */ -+ -+ if((_getDecorations() & (TEXT_DECOR_UNDERLINE | TEXT_DECOR_OVERLINE | -+ TEXT_DECOR_LINETHROUGH | TEXT_DECOR_TOPLINE | TEXT_DECOR_BOTTOMLINE)) == 0) -+ { -+ return; -+ } -+ -+ GR_Painter painter(pG); -+ const UT_sint32 old_LineWidth = m_iLineWidth; -+ UT_sint32 cur_linewidth = pG->tlu(1) + UT_MAX(pG->tlu(10),static_cast(getAscent())-pG->tlu(10))/8; -+// -+// Line thickness is too thick. -+// -+ cur_linewidth = UT_MAX(pG->tlu(1),cur_linewidth/2); -+ UT_sint32 iDrop = 0; -+ -+ // need to do this in the visual space -+ fp_Run* P_Run = getPrevVisual(); -+ fp_Run* N_Run = getNextVisual(); -+ -+ const bool b_Underline = isUnderline(); -+ const bool b_Overline = isOverline(); -+ const bool b_Strikethrough = isStrikethrough(); -+ const bool b_Topline = isTopline(); -+ const bool b_Bottomline = isBottomline(); -+ -+ // again, need to do this in visual space -+ const bool b_Firstrun = (P_Run == NULL) || (getLine()->getFirstVisRun()== this); -+ const bool b_Lastrun = (N_Run == NULL) || (getLine()->getLastVisRun()== this); -+ -+ /* If the previous run is NULL or if this is the first run of a -+ line, we are on the first run of the line so set the linethickness, -+ start of the line span and the overline and underline positions from -+ the current measurements. -+ */ -+ if(P_Run == NULL || b_Firstrun ) -+ { -+ setLinethickness(cur_linewidth); -+ if(b_Underline) -+ { -+ iDrop = yoff + getAscent() + getDescent()/3 + pG->tlu(1); -+ xxx_UT_DEBUGMSG(("underline getAscent() %d getDescent() %d tlu 1 %d \n",getAscent(),getDescent(), pG->tlu(1))); -+ setUnderlineXoff( xoff); -+ setMaxUnderline(iDrop); -+ } -+ if(b_Overline) -+ { -+ iDrop = yoff + pG->tlu(1) + UT_MAX(pG->tlu(10),static_cast(getAscent()) - pG->tlu(10))/8; -+ setOverlineXoff( xoff); -+ setMinOverline(iDrop); -+ } -+ } -+ /* -+ Otherwise look to see if the previous run had an underline or -+overline. If it does, merge the information with the present information. Take -+the Maximum of the underline offsets and the minimum of the overline offsets. -+Always take the maximum of the linewidths. If there is no previous underline -+or overline set the underline and overline locations with the current data. -+ */ -+ else -+ { -+ if (!P_Run->isUnderline() && !P_Run->isOverline() && -+ !P_Run->isStrikethrough()) -+ { -+ setLinethickness(cur_linewidth); -+ } -+ else -+ { -+ setLinethickness(UT_MAX(P_Run->getLinethickness(),cur_linewidth)); -+ } -+ if (b_Underline) -+ { -+ iDrop = yoff + getAscent() + getDescent()/3; -+ xxx_UT_DEBUGMSG(("underline getAscent() %d getDescent() %d m_iDescent %d \n",getAscent(),getDescent(),m_iDescent)); -+ if(!P_Run->isUnderline()) -+ { -+ setUnderlineXoff( xoff); -+ setMaxUnderline(iDrop); -+ } -+ else -+ { -+ setUnderlineXoff( P_Run->getUnderlineXoff()); -+ setMaxUnderline(UT_MAX( P_Run->getMaxUnderline(), iDrop)); -+ } -+ } -+ if (b_Overline) -+ { -+ iDrop = yoff + pG->tlu(1) + UT_MAX(pG->tlu(10),static_cast(getAscent()) - pG->tlu(10))/8; -+ if(!P_Run->isOverline()) -+ { -+ setOverlineXoff( xoff); -+ setMinOverline(iDrop); -+ } -+ else -+ { -+ setOverlineXoff( P_Run->getOverlineXoff()); -+ setMinOverline(UT_MIN( P_Run->getMinOverline(), iDrop)); -+ } -+ } -+ } -+ m_iLineWidth = getLinethickness(); -+ pG->setLineWidth(m_iLineWidth); -+ /* -+ If the next run returns NULL or if we are on the last run -+ we've reached the of the line of text so the overlines and underlines must -+be drawn. -+ */ -+ if(N_Run == NULL || b_Lastrun) -+ { -+ if ( b_Underline) -+ { -+ iDrop = UT_MAX( getMaxUnderline(), iDrop); -+ UT_sint32 totx = getUnderlineXoff(); -+ painter.drawLine(totx, iDrop, xoff+getWidth(), iDrop); -+ } -+ if ( b_Overline) -+ { -+ iDrop = UT_MIN( getMinOverline(), iDrop); -+ UT_sint32 totx = getOverlineXoff(); -+ painter.drawLine(totx, iDrop, xoff+getWidth(), iDrop); -+ } -+ } -+ /* -+ Otherwise look to see if the next run has an underline or overline -+if not, draw the line, if does mark the next run as dirty to make sure it -+is drawn later. -+ */ -+ else -+ { -+ if ( b_Underline ) -+ { -+ if(!N_Run->isUnderline() || isSelectionDraw()) -+ { -+ iDrop = UT_MAX( getMaxUnderline(), iDrop); -+ UT_sint32 totx = getUnderlineXoff(); -+ xxx_UT_DEBUGMSG(("Underlining y-logical %d \n",iDrop)); -+ painter.drawLine(totx, iDrop, xoff+getWidth(), iDrop); -+ } -+ else -+ { -+ N_Run->markAsDirty(); -+ } -+ } -+ if ( b_Overline ) -+ { -+ if(!N_Run->isOverline() || isSelectionDraw()) -+ { -+ iDrop = UT_MIN( getMinOverline(), iDrop); -+ UT_sint32 totx = getOverlineXoff(); -+ painter.drawLine(totx, iDrop, xoff+getWidth(), iDrop); -+ } -+ else -+ { -+ N_Run->markAsDirty(); -+ } -+ } -+ } -+ /* -+ We always want strikethrough to go right through the middle of the -+text so we can keep the original code. -+ */ -+ if ( b_Strikethrough) -+ { -+ iDrop = yoff + getAscent() * 2 / 3; -+ painter.drawLine(xoff, iDrop, xoff+getWidth(), iDrop); -+ } -+ /* -+ Restore the previous line width. -+ */ -+ _setLineWidth(old_LineWidth); -+ pG->setLineWidth(_getLineWidth()); -+ if(!b_Topline && !b_Bottomline) -+ return; -+ /* -+ We always draw Topline right at the top of the line so there is no ambiguity -+ */ -+ UT_sint32 ithick = getToplineThickness(); -+ -+ UT_RGBColor clrFG; -+ const PP_AttrProp * pSpanAP = NULL; -+ const PP_AttrProp * pBlockAP = NULL; -+ const PP_AttrProp * pSectionAP = NULL; -+ -+ PD_Document * pDoc = getBlock()->getDocument(); -+ -+ getSpanAP(pSpanAP); -+ getBlockAP(pBlockAP); -+ UT_parseColor(PP_evalProperty("color",pSpanAP,pBlockAP, pSectionAP, pDoc, true), clrFG); -+ -+ // This gives the baseline of the selection. -+ // need to clear full height of line, in case we had a selection -+// UT_sint32 xxoff=0 ,ybase =0; -+// getLine()->getScreenOffsets(this, xxoff, ybase); -+ -+ -+ if ( b_Topline) -+ { -+ UT_sint32 ybase = yoff + getAscent() - getLine()->getAscent() + pG->tlu(1); -+ painter.fillRect(clrFG, xoff, ybase, getWidth(), ithick); -+ } -+ /* -+ We always draw bottomline right at the bottom so there is no ambiguity -+ */ -+ if ( b_Bottomline) -+ { -+ painter.fillRect(clrFG, xoff, yoff+getLine()->getHeight()-ithick+pG->tlu(1), getWidth(), ithick); -+ } -+} -+ -+inline bool fp_Run::isUnderline(void) const -+{ -+ return ((m_fDecorations & TEXT_DECOR_UNDERLINE) != 0); -+} -+ -+ -+inline bool fp_Run::isOverline(void) const -+{ -+ return ((m_fDecorations & TEXT_DECOR_OVERLINE) != 0); -+} -+ -+inline bool fp_Run::isStrikethrough(void) const -+{ -+ return ((m_fDecorations & TEXT_DECOR_LINETHROUGH) != 0); -+} -+ -+ -+inline bool fp_Run::isTopline(void) const -+{ -+ return ((m_fDecorations & TEXT_DECOR_TOPLINE) != 0); -+} -+ -+ -+inline bool fp_Run::isBottomline(void) const -+{ -+ return ((m_fDecorations & TEXT_DECOR_BOTTOMLINE) != 0); -+} -+ -+void fp_Run::setLinethickness(UT_sint32 max_linethickness) -+{ -+ m_iLinethickness = max_linethickness; -+} -+ -+void fp_Run::setUnderlineXoff(UT_sint32 xoff) -+{ -+ m_iUnderlineXoff = xoff; -+} -+ -+UT_sint32 fp_Run::getUnderlineXoff(void) -+{ -+ return m_iUnderlineXoff; -+} -+ -+void fp_Run::setOverlineXoff(UT_sint32 xoff) -+{ -+ m_iOverlineXoff = xoff; -+} -+ -+UT_sint32 fp_Run::getOverlineXoff(void) -+{ -+ return m_iOverlineXoff; -+} -+ -+void fp_Run::setMaxUnderline(UT_sint32 maxh) -+{ -+ m_imaxUnderline = maxh; -+} -+ -+UT_sint32 fp_Run::getMaxUnderline(void) -+{ -+ return m_imaxUnderline; -+} -+ -+void fp_Run::setMinOverline(UT_sint32 minh) -+{ -+ m_iminOverline = minh; -+} -+ -+UT_sint32 fp_Run::getMinOverline(void) -+{ -+ return m_iminOverline; -+} -+ -+UT_sint32 fp_Run::getLinethickness( void) -+{ -+ return m_iLinethickness; -+} -+ -+UT_sint32 fp_Run::getToplineThickness(void) -+{ -+ return UT_convertToLogicalUnits("0.8pt"); -+} -+ -+/*! -+ * This draws a line with some text in the center. -+ * \param xOff the x offset of the left end of the line -+ * \param yOff the y offset of the top (maybe bottom, I don't know) of -+ * the line -+ * \param iWidth the desired length of the line. -+ * \param iHeight the desired height of the line. Note that the line -+ * will almost certainly take up more vertical space than this, since -+ * the text will be taller than the line. -+ * \param pText the text to be displayed in the middle of the line -+ * \bug Currently, this does not detect whether it is on the screen or -+ * not, so it redraws way too often. -+*/ -+void fp_Run::_drawTextLine(UT_sint32 xoff,UT_sint32 yoff,UT_uint32 iWidth,UT_uint32 iHeight,UT_UCSChar *pText) -+{ -+ GR_Font *pFont = getGraphics()->getGUIFont(); -+ -+ GR_Painter painter(getGraphics()); -+ getGraphics()->setFont(pFont); -+ -+ UT_uint32 iTextLen = UT_UCS4_strlen(pText); -+ UT_uint32 iTextWidth = getGraphics()->measureString(pText,0,iTextLen,NULL); -+ UT_uint32 iTextHeight = getGraphics()->getFontHeight(pFont); -+ -+ UT_uint32 xoffText = xoff + (iWidth - iTextWidth) / 2; -+ UT_uint32 yoffText = yoff - getGraphics()->getFontAscent(pFont) * 2 / 3; -+ -+ painter.drawLine(xoff,yoff,xoff + iWidth,yoff); -+ -+ if((iTextWidth < iWidth) && (iTextHeight < iHeight)) -+ { -+ Fill(getGraphics(),xoffText,yoffText,iTextWidth,iTextHeight); -+ painter.drawChars(pText,0,iTextLen,xoffText,yoffText); -+ } -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+fp_TabRun::fp_TabRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) -+ : fp_Run(pBL, iOffsetFirst, iLen, FPRUN_TAB), -+ m_leader(FL_LEADER_NONE), -+ m_TabType(FL_TAB_NONE), -+ m_bIsTOC(false), -+ m_bIsTOCListLabel(false) -+{ -+ lookupProperties(); -+} -+ -+void fp_TabRun::_lookupProperties(const PP_AttrProp * pSpanAP, -+ const PP_AttrProp * pBlockAP, -+ const PP_AttrProp * pSectionAP, -+ GR_Graphics * pG) -+{ -+ bool bChanged = false; -+ -+ fd_Field * fd = NULL; -+ getBlock()->getField(getBlockOffset(),fd); -+ _setField(fd); -+ if(pG == NULL) -+ { -+ pG = getGraphics(); -+ } -+ UT_RGBColor clrFG; -+ UT_parseColor(PP_evalProperty("color",pSpanAP,pBlockAP,pSectionAP, getBlock()->getDocument(), true), clrFG); -+ bChanged |= (clrFG != _getColorFG()); -+ _setColorFG(clrFG); -+ -+ // look for fonts in this DocLayout's font cache -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ const GR_Font * pFont = pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,getGraphics()); -+ -+ if (pFont != _getFont()) -+ { -+ _setFont(pFont); -+ _setAscent(pG->getFontAscent(pFont)); -+ _setDescent(pG->getFontDescent(pFont)); -+ _setHeight(pG->getFontHeight(pFont)); -+ bChanged = true; -+ } -+ -+ if(getDirection() != UT_BIDI_WS) -+ { -+ _setDirection(UT_BIDI_WS); -+ bChanged = true; -+ //setDirectionProperty(UT_BIDI_WS); -+ } -+// -+// Lookup Decoration properties for this run -+// -+ const gchar *pszDecor = PP_evalProperty("text-decoration",pSpanAP,pBlockAP,pSectionAP, getBlock()->getDocument(), true); -+ _setLineWidth(getToplineThickness()); -+ -+ UT_uint32 oldDecors = _getDecorations(); -+ _setDecorations(0); -+ gchar* p; -+ if (!(p = g_strdup(pszDecor))) -+ { -+ // TODO outofmem -+ } -+ UT_ASSERT(p || !pszDecor); -+ gchar* q = strtok(p, " "); -+ -+ while (q) -+ { -+ if (0 == strcmp(q, "underline")) -+ { -+ _orDecorations(TEXT_DECOR_UNDERLINE); -+ } -+ else if (0 == strcmp(q, "overline")) -+ { -+ _orDecorations(TEXT_DECOR_OVERLINE); -+ } -+ else if (0 == strcmp(q, "line-through")) -+ { -+ _orDecorations(TEXT_DECOR_LINETHROUGH); -+ } -+ else if (0 == strcmp(q, "topline")) -+ { -+ _orDecorations(TEXT_DECOR_TOPLINE); -+ } -+ else if (0 == strcmp(q, "bottomline")) -+ { -+ _orDecorations(TEXT_DECOR_BOTTOMLINE); -+ } -+ q = strtok(NULL, " "); -+ } -+ g_free(p); -+ -+ bChanged |= (oldDecors != _getDecorations()); -+ -+ if(bChanged) -+ clearScreen(); -+ -+} -+ -+bool fp_TabRun::canBreakAfter(void) const -+{ -+ return false; -+} -+ -+bool fp_TabRun::canBreakBefore(void) const -+{ -+ return false; -+} -+ -+bool fp_TabRun::_letPointPass(void) const -+{ -+ return true; -+} -+ -+bool fp_TabRun::hasLayoutProperties(void) const -+{ -+ return true; -+} -+ -+void fp_TabRun::mapXYToPosition(UT_sint32 x, UT_sint32 /*y*/, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ // If X is left of the middle, return offset to the left, -+ // otherwise the offset to the right. -+ if (x < (getWidth() / 2)) -+ pos = getBlock()->getPosition() + getBlockOffset(); -+ else -+ pos = getBlock()->getPosition() + getBlockOffset() + getLength(); -+ -+ bBOL = false; -+ bEOL = false; -+} -+ -+void fp_TabRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ //UT_DEBUGMSG(("fintPointCoords: TabRun\n")); -+ UT_sint32 xoff; -+ UT_sint32 yoff; -+ UT_sint32 xoff2; -+ UT_sint32 yoff2; -+ -+ UT_ASSERT(getLine()); -+ if(getLine()->getY() == -2000000) -+ { -+ // UT_ASSERT(UT_SHOULD_NOT_HAPPEN); // might need this later -+ } -+ getLine()->getOffsets(this, xoff, yoff); -+ -+ fp_Run * pRun = 0; -+ UT_sint32 iNextDir = getVisDirection(); -+ -+ if (iOffset == (getBlockOffset() + getLength())) //#TF is this the right-most logical element of the run? -+ { -+ pRun = getNextRun(); -+ if(pRun) -+ { -+ pRun->getLine()->getOffsets(pRun, xoff2, yoff2); -+ iNextDir = pRun->getVisDirection(); -+ } -+ } -+ -+ UT_sint32 iDirection = getVisDirection(); -+ -+ x = xoff; -+ -+ if(iDirection == UT_BIDI_LTR) -+ { -+ xxx_UT_DEBUGMSG(("iOffset %d, getBlockOffset() %d, getLength() %d\n", iOffset,getBlockOffset(),getLength())); -+ if(iOffset != getBlockOffset()) -+ { -+ // this happens when a tab run is last run in a block and the eop's run -+ //findPointCoords() is called ... -+ //UT_ASSERT(iOffset == (getBlockOffset() + getLength())); -+ x += getWidth(); -+ } -+ } -+ else -+ { -+ if(iOffset == getBlockOffset()) -+ { -+ x += getWidth(); -+ } -+ } -+ -+ -+ if(pRun && (iNextDir != iDirection)) //if this run precedes run of different direction, we have to split the caret -+ { -+ x2 = (iNextDir == UT_BIDI_LTR) ? xoff + pRun->getWidth() : xoff2; -+ y2 = yoff2; -+ } -+ else -+ { -+ x2 = x; -+ y2 = yoff; -+ } -+ -+ bDirection = (iDirection != UT_BIDI_LTR); -+ y = yoff; -+ height = getHeight(); -+} -+ -+bool fp_TabRun::isTOCTab(void) -+{ -+ return m_bIsTOC; -+} -+ -+ -+void fp_TabRun::setTOCTabListLabel(void) -+{ -+ m_bIsTOCListLabel = true; -+ _setLength(0); -+ m_leader = FL_LEADER_NONE; -+ m_TabType = FL_TAB_LEFT; -+} -+ -+void fp_TabRun::setTabWidth(UT_sint32 iWidth) -+{ -+ clearScreen(); -+ fp_Run::_setWidth(iWidth); -+} -+ -+void fp_TabRun::setLeader(eTabLeader iLeader) -+{ -+ clearScreen(); -+ m_leader = iLeader; -+} -+ -+eTabLeader fp_TabRun::getLeader(void) -+{ -+ return m_leader; -+} -+ -+ -+void fp_TabRun::setTabType(eTabType iTabType) -+{ -+ m_TabType = iTabType; -+} -+ -+eTabType fp_TabRun::getTabType(void) const -+{ -+ return m_TabType; -+} -+ -+ -+void fp_TabRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+ // UT_ASSERT(!isDirty()); -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+ -+ UT_sint32 xoff = 0, yoff = 0; -+ -+ // need to clear full height of line, in case we had a selection -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ Fill(getGraphics(),xoff, yoff, getWidth(), getLine()->getHeight()); -+} -+ -+void fp_TabRun::_drawArrow(UT_uint32 iLeft,UT_uint32 iTop,UT_uint32 iWidth, UT_uint32 iHeight) -+{ -+ if (!(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN))){ -+ return; -+ } -+ -+#define NPOINTS 6 -+ -+ UT_Point points[NPOINTS]; -+ -+ UT_sint32 cur_linewidth = getGraphics()->tlu(1) + UT_MAX(getGraphics()->tlu(10),static_cast(getAscent()) - getGraphics()->tlu(10)) / 8; -+ UT_uint32 iyAxis = iTop + getLine()->getAscent() * 2 / 3; -+ UT_uint32 iMaxWidth = UT_MIN(iWidth / 10 * 6, static_cast(cur_linewidth) * 9); -+ UT_uint32 ixGap = (iWidth - iMaxWidth) / 2; -+ -+ //UT_DEBUGMSG(("iLeft %d, iWidth %d, visDir \"%s\"\n", iLeft,iWidth, getVisDirection() == UT_BIDI_LTR ? "ltr":"rtl")); -+ if(getVisDirection() == UT_BIDI_LTR) -+ { -+ points[0].x = iLeft + ixGap + iMaxWidth - cur_linewidth * 4; -+ points[0].y = iyAxis - cur_linewidth * 2; -+ -+ points[1].x = points[0].x + cur_linewidth; -+ points[1].y = points[0].y; -+ -+ points[2].x = iLeft + iWidth - ixGap; -+ points[2].y = iyAxis; -+ } -+ else -+ { -+ //iLeftAdj -= getWidth(); -+ -+ points[0].x = iLeft + ixGap + cur_linewidth * 4; -+ points[0].y = iyAxis - cur_linewidth * 2; -+ -+ points[1].x = points[0].x - cur_linewidth; -+ points[1].y = points[0].y; -+ -+ points[2].x = iLeft + ixGap; -+ points[2].y = iyAxis; -+ -+ } -+ -+ points[3].x = points[1].x; -+ points[3].y = iyAxis + cur_linewidth * 2; -+ -+ points[4].x = points[0].x; -+ points[4].y = points[3].y; -+ -+ points[5].x = points[0].x; -+ points[5].y = points[0].y; -+ -+ GR_Painter painter(getGraphics()); -+ -+ UT_RGBColor clrShowPara(_getView()->getColorShowPara()); -+ painter.polygon(clrShowPara,points,NPOINTS); -+ -+ xxx_UT_DEBUGMSG(("fp_TabRun::_drawArrow: iLeft %d, iyAxis %d, cur_linewidth %d, iMaxWidth %d\n", -+ iLeft, iyAxis, cur_linewidth, iMaxWidth)); -+ -+ // only draw the rectangle if iMaxWidth - cur_linewidth * 4 > 0, otherwise -+ // we get the rect running pass the end of the line and off the screen -+ if(static_cast(iMaxWidth - cur_linewidth * 4) > 0) -+ if(getVisDirection() == UT_BIDI_LTR) -+ { -+ painter.fillRect(clrShowPara,iLeft + ixGap,iyAxis - cur_linewidth / 2,iMaxWidth - cur_linewidth * 4,cur_linewidth); -+ } -+ else -+ { -+ painter.fillRect(clrShowPara,iLeft + ixGap + cur_linewidth * 4,iyAxis - cur_linewidth / 2,iMaxWidth - cur_linewidth * 4,cur_linewidth); -+ } -+#undef NPOINTS -+} -+ -+void fp_TabRun::_draw(dg_DrawArgs* pDA) -+{ -+ xxx_UT_DEBUGMSG(("fp_TabRun::_draw (0x%x)\n",this)); -+ GR_Graphics * pG = pDA->pG; -+ -+ // need to draw to the full height of line to join with line above. -+ UT_sint32 xoff= 0, yoff=0, DA_xoff = pDA->xoff; -+ -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ -+ // need to clear full height of line, in case we had a selection -+ -+ UT_sint32 iFillHeight = getLine()->getHeight(); -+ UT_sint32 iFillTop = pDA->yoff - getLine()->getAscent(); -+ -+ xxx_UT_DEBUGMSG(("iFillTop Tab %d YTopOfRun %d \n",iFillTop, pDA->yoff - getAscent())); -+ FV_View* pView = _getView(); -+ UT_uint32 iSelAnchor = pView->getSelectionAnchor(); -+ UT_uint32 iPoint = pView->getPoint(); -+ -+ UT_uint32 iSel1 = UT_MIN(iSelAnchor, iPoint); -+ UT_uint32 iSel2 = UT_MAX(iSelAnchor, iPoint); -+ -+ UT_ASSERT(iSel1 <= iSel2); -+ -+ UT_uint32 iRunBase = getBlock()->getPosition() + getOffsetFirstVis(); //getBlockOffset(); -+ -+ UT_RGBColor clrFG; -+ const PP_AttrProp * pSpanAP = NULL; -+ const PP_AttrProp * pBlockAP = NULL; -+ const PP_AttrProp * pSectionAP = NULL; -+ -+ PD_Document * pDoc = getBlock()->getDocument(); -+ -+ getSpanAP(pSpanAP); -+ getBlockAP(pBlockAP); -+ -+ UT_parseColor(PP_evalProperty("color",pSpanAP,pBlockAP, pSectionAP, pDoc, true), clrFG); -+ -+ GR_Painter painter(pG); -+ -+ if ( isInSelectedTOC() || -+ /* pView->getFocus()!=AV_FOCUS_NONE && */ -+ (iSel1 <= iRunBase) -+ && (iSel2 > iRunBase) -+ ) -+ { -+ painter.fillRect(_getView()->getColorSelBackground(), /*pDA->xoff*/DA_xoff, iFillTop, getWidth(), iFillHeight); -+ if(pView->getShowPara()){ -+ _drawArrow(/*pDA->xoff*/DA_xoff, iFillTop, getWidth(), iFillHeight); -+ } -+ } -+ else -+ { -+ Fill(pG,DA_xoff, iFillTop, getWidth(), iFillHeight); -+ if(pView->getShowPara()){ -+ _drawArrow(/*pDA->xoff*/DA_xoff, iFillTop, getWidth(), iFillHeight); -+ } -+ } -+ if (m_leader != FL_LEADER_NONE) -+ { -+ UT_UCSChar tmp[151]; -+ UT_GrowBufElement wid[151]; -+ int i, cumWidth; -+ -+ tmp[0] = 150; -+ switch (m_leader) -+ { -+ case FL_LEADER_DOT: -+ tmp[1] = '.'; -+ break; -+ case FL_LEADER_HYPHEN: -+ tmp[1] = '-'; -+ break; -+ case FL_LEADER_UNDERLINE: -+ tmp[1] = '_'; -+ break; -+ default: -+ tmp[1] = ' '; -+ break; -+ } -+ -+ for (i = 2; i < 151; i++) -+ tmp[i] = tmp[1]; -+ -+ -+ pG->setFont(_getFont()); -+ pG->measureString(tmp, 1, 150, wid); -+ // one would think that one could measure -+ // one character and divide the needed -+ // width by that; would one be so wrong? -+ // we're not dealing with different letters -+ // here, after all. -+ -+ i = 1; -+ cumWidth = 0; -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ UT_sint32 iTabTop = pDA->yoff - getAscent(); -+ if(pG && pLayout->isQuickPrint() && pG->queryProperties(GR_Graphics::DGP_PAPER)) -+ { -+ iTabTop = pDA->yoff - pG->getFontAscent(_getFont()); -+ } -+ while (cumWidth < getWidth() && i < 151) -+ { -+ if(pG && pLayout->isQuickPrint() && pG->queryProperties(GR_Graphics::DGP_PAPER)) -+ { -+ wid[i] = static_cast(wid[i]*pG->getResolutionRatio()); -+ } -+ cumWidth += wid[i++]; -+ } -+ i = (i>=3) ? i - 2 : 1; -+ pG->setColor(clrFG); -+ painter.drawChars(tmp, 1, i, /*pDA->xoff*/DA_xoff, iTabTop,wid); -+ } -+// -+// Draw underline/overline/strikethough -+// -+ UT_sint32 yTopOfRun = pDA->yoff - getAscent()-1; // Hack to remove -+ //character dirt -+ drawDecors( xoff, yTopOfRun,pG); -+// -+// Draw bar seperators -+// -+ if(FL_TAB_BAR == getTabType()) -+ { -+ // need to draw to the full height of line to join with line above. -+ UT_sint32 iFillHeight = getLine()->getHeight(); -+// -+// Scale the vertical line thickness for printers -+// -+ UT_sint32 ithick = getToplineThickness(); -+ painter.fillRect(clrFG, /*pDA->xoff*/DA_xoff+getWidth()-ithick, iFillTop, ithick, iFillHeight); -+ } -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+fp_ForcedLineBreakRun::fp_ForcedLineBreakRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_Run(pBL, iOffsetFirst, iLen, FPRUN_FORCEDLINEBREAK) -+{ -+ //UT_DEBUGMSG(("fp_ForcedLineBreakRun constructor\n")); -+ lookupProperties(); -+} -+ -+void fp_ForcedLineBreakRun::_lookupProperties(const PP_AttrProp * pSpanAP, -+ const PP_AttrProp * pBlockAP, -+ const PP_AttrProp * pSectionAP, -+ GR_Graphics * pG) -+{ -+ //UT_DEBUGMSG(("fp_ForcedLineBreakRun::lookupProperties\n")); -+ fd_Field * fd = NULL; -+ getBlock()->getField(getBlockOffset(),fd); -+ _setField(fd); -+ if(pG == NULL) -+ { -+ pG = getGraphics(); -+ } -+ _inheritProperties(); -+ FV_View* pView = _getView(); -+ if (pView && pView->getShowPara()) -+ { -+ //UT_UCSChar pEOP[] = { UCS_LINESEP, 0 }; - see bug 1279 -+ UT_UCSChar pEOP[] = { '^', 'l', 0 }; -+ UT_uint32 iTextLen = UT_UCS4_strlen(pEOP); -+ -+ fp_Run* pPropRun = _findPrevPropertyRun(); -+ if (pPropRun && (FPRUN_TEXT == pPropRun->getType())) -+ { -+ fp_TextRun* pTextRun = static_cast(pPropRun); -+ pG->setFont(pTextRun->getFont()); -+ } -+ else -+ { -+ // look for fonts in this DocLayout's font cache -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ -+ const GR_Font * pFont = pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,getGraphics()); -+ getGraphics()->setFont(pFont); -+ } -+ _setWidth(getGraphics()->measureString(pEOP, 0, iTextLen, NULL)); -+ xxx_UT_DEBUGMSG(("fp_EndOfParagraphRun::lookupProperties: width %d\n", getWidth())); -+ } -+ else -+ { -+ _setWidth(16); -+ } -+} -+ -+bool fp_ForcedLineBreakRun::canBreakAfter(void) const -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ -+ return false; -+} -+ -+bool fp_ForcedLineBreakRun::canBreakBefore(void) const -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ -+ return false; -+} -+ -+bool fp_ForcedLineBreakRun::_letPointPass(void) const -+{ -+ return false; -+} -+ -+void fp_ForcedLineBreakRun::mapXYToPosition(UT_sint32 /* x */, UT_sint32 /*y*/, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ //UT_DEBUGMSG(("fp_ForcedLineBreakRun::mapXYToPosition\n")); -+ pos = getBlock()->getPosition() + getBlockOffset(); -+ bBOL = false; -+ bEOL = false; -+} -+ -+void fp_ForcedLineBreakRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ // this assert is wrong -- a run can be asked to return coords for position it does -+ // not contain if the run which contains it cannot contain point -+ // UT_ASSERT(getBlockOffset() == iOffset || getBlockOffset()+1 == iOffset); -+ -+ UT_sint32 xoff, yoff; -+ -+ fp_Run* pPropRun = _findPrevPropertyRun(); -+ -+ if (pPropRun) -+ { -+ if(FPRUN_TEXT == pPropRun->getType()) -+ { -+ pPropRun->findPointCoords(iOffset, x, y, x2, y2, height, bDirection); -+ } -+ else -+ { -+ height = getHeight(); -+ getLine()->getOffsets(this, xoff, yoff); -+ x = xoff; -+ y = yoff; -+ } -+ } -+ else -+ { -+ height = getHeight(); -+ getLine()->getOffsets(this, xoff, yoff); -+ x = xoff; -+ y = yoff; -+ } -+ -+ if (iOffset == getBlockOffset()+1) -+ { -+ FV_View* pView = _getView(); -+ if (pView && pView->getShowPara()) -+ { -+ x += getWidth(); -+ } -+ } -+ -+ x2 = x; -+ y2 = y; -+ //UT_DEBUGMSG(("fintPointCoords: ForcedLineBreakRun: x=%d, y=%d, h=%d\n", x,y,height)); -+} -+ -+void fp_ForcedLineBreakRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+ // UT_ASSERT(!isDirty()); -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+} -+ -+void fp_ForcedLineBreakRun::_draw(dg_DrawArgs* pDA) -+{ -+ -+ UT_sint32 iXoffText = 0; -+ UT_sint32 iYoffText = 0; -+ -+ FV_View* pView = _getView(); -+ if(!pView || !pView->getShowPara()) -+ { -+ if(getWidth()) -+ { -+ _setWidth(0); -+ } -+ return; -+ } -+ -+ GR_Painter painter(getGraphics()); -+ -+ UT_uint32 iRunBase = getBlock()->getPosition() + getBlockOffset(); -+ -+ UT_uint32 iSelAnchor = pView->getSelectionAnchor(); -+ UT_uint32 iPoint = pView->getPoint(); -+ -+ UT_uint32 iSel1 = UT_MIN(iSelAnchor, iPoint); -+ UT_uint32 iSel2 = UT_MAX(iSelAnchor, iPoint); -+ -+ UT_ASSERT(iSel1 <= iSel2); -+ -+ bool bIsSelected = false; -+ if (/* pView->getFocus()!=AV_FOCUS_NONE && */ isInSelectedTOC() || (iSel1 <= iRunBase) && (iSel2 > iRunBase)) -+ bIsSelected = true; -+ -+ UT_RGBColor clrShowPara(pView->getColorShowPara()); -+ -+ //UT_UCSChar pEOP[] = { UCS_LINESEP, 0 }; -+ UT_UCSChar pEOP[] = { '^', 'l', 0 }; -+ UT_uint32 iTextLen = UT_UCS4_strlen(pEOP); -+ UT_sint32 iAscent; -+ -+ fp_Run* pPropRun = _findPrevPropertyRun(); -+ if (pPropRun && (FPRUN_TEXT == pPropRun->getType())) -+ { -+ fp_TextRun* pTextRun = static_cast(pPropRun); -+ getGraphics()->setFont(pTextRun->getFont()); -+ iAscent = pTextRun->getAscent(); -+ } -+ else -+ { -+ const PP_AttrProp * pSpanAP = NULL; -+ const PP_AttrProp * pBlockAP = NULL; -+ const PP_AttrProp * pSectionAP = NULL; -+ -+ getSpanAP(pSpanAP); -+ getBlockAP(pBlockAP); -+ -+ // look for fonts in this DocLayout's font cache -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ -+ const GR_Font * pFont = pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,getGraphics()); -+ getGraphics()->setFont(pFont); -+ iAscent = getGraphics()->getFontAscent(); -+ } -+ -+ // if we currently have a 0 width, i.e., we draw in response to the -+ // showPara being turned on, then we obtain the new width, and then -+ // tell the line to redo its layout and redraw instead of drawing ourselves -+ // bool bWidthChange = false; -+ // if(!getWidth()) -+ // bWidthChange = true; -+ -+ _setWidth(getGraphics()->measureString(pEOP, 0, iTextLen, NULL)); -+ // if(bWidthChange) -+ // { -+ // getLine()->layout(); -+ // getLine()->redrawUpdate(); -+ // return; -+ // } -+ -+ _setHeight(getGraphics()->getFontHeight()); -+ iXoffText = pDA->xoff; -+ -+ if(getBlock()->getDominantDirection() == UT_BIDI_RTL) -+ { -+ iXoffText -= getWidth(); -+ } -+ -+ iYoffText = pDA->yoff - iAscent; -+ xxx_UT_DEBUGMSG(("fp_EndOfParagraphRun::draw: width %d\n", getWidth())); -+ -+ if (bIsSelected) -+ { -+ painter.fillRect(_getView()->getColorSelBackground(), iXoffText, iYoffText, getWidth(), getLine()->getHeight()); -+ } -+ else -+ { -+ Fill(getGraphics(),iXoffText, iYoffText, getWidth(), getLine()->getHeight()); -+ } -+ if (pView->getShowPara()) -+ { -+ // Draw pilcrow -+ getGraphics()->setColor(clrShowPara); -+ painter.drawChars(pEOP, 0, iTextLen, iXoffText, iYoffText); -+ } -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+fp_FieldStartRun::fp_FieldStartRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_Run(pBL, iOffsetFirst, iLen, FPRUN_FIELDSTARTRUN) -+{ -+ lookupProperties(); -+} -+ -+void fp_FieldStartRun::_lookupProperties(const PP_AttrProp * /*pSpanAP*/, -+ const PP_AttrProp * /*pBlockAP*/, -+ const PP_AttrProp * /*pSectionAP*/, -+ GR_Graphics *) -+{ -+ fd_Field * fd = NULL; -+ getBlock()->getField(getBlockOffset(),fd); -+ _setField(fd); -+ _setWidth(0); -+} -+ -+bool fp_FieldStartRun::canBreakAfter(void) const -+{ -+ return true; -+} -+ -+bool fp_FieldStartRun::canBreakBefore(void) const -+{ -+ return true; -+} -+ -+bool fp_FieldStartRun::_letPointPass(void) const -+{ -+ return true; -+} -+ -+void fp_FieldStartRun::mapXYToPosition(UT_sint32 /* x */, UT_sint32 /*y*/, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ -+ pos = getBlock()->getPosition() + getBlockOffset(); -+ bBOL = false; -+ bEOL = false; -+} -+ -+ -+void fp_FieldStartRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+} -+ -+void fp_FieldStartRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+ // UT_ASSERT(!isDirty()); -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+} -+ -+void fp_FieldStartRun::_draw(dg_DrawArgs* pDA) -+{ -+ -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+fp_FieldEndRun::fp_FieldEndRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_Run(pBL, iOffsetFirst, iLen, FPRUN_FIELDENDRUN) -+{ -+ lookupProperties(); -+} -+ -+void fp_FieldEndRun::_lookupProperties(const PP_AttrProp * /*pSpanAP*/, -+ const PP_AttrProp * /*pBlockAP*/, -+ const PP_AttrProp * /*pSectionAP*/, -+ GR_Graphics *) -+{ -+ fd_Field * fd = NULL; -+ getBlock()->getField(getBlockOffset(),fd); -+ _setField(fd); -+ _setWidth(0); -+} -+ -+bool fp_FieldEndRun::canBreakAfter(void) const -+{ -+ return true; -+} -+ -+bool fp_FieldEndRun::canBreakBefore(void) const -+{ -+ return true; -+} -+ -+bool fp_FieldEndRun::_letPointPass(void) const -+{ -+ return true; -+} -+ -+void fp_FieldEndRun::mapXYToPosition(UT_sint32 /* x */, UT_sint32 /*y*/, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ -+ pos = getBlock()->getPosition() + getBlockOffset(); -+ bBOL = false; -+ bEOL = false; -+} -+ -+void fp_FieldEndRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+} -+ -+void fp_FieldEndRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+ // UT_ASSERT(!isDirty()); -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+} -+ -+void fp_FieldEndRun::_draw(dg_DrawArgs* pDA) -+{ -+ -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+ -+ -+fp_BookmarkRun::fp_BookmarkRun( fl_BlockLayout* pBL, -+ UT_uint32 iOffsetFirst, -+ UT_uint32 iLen) -+ : fp_Run(pBL, iOffsetFirst, iLen, FPRUN_BOOKMARK) -+{ -+ m_pBookmark = getBlock()->getBookmark(iOffsetFirst); -+ UT_return_if_fail(m_pBookmark); -+ -+ _setDirty(true); -+ -+ UT_ASSERT((pBL)); -+ _setDirection(UT_BIDI_WS); -+ -+ m_bIsStart = (po_Bookmark::POBOOKMARK_START == m_pBookmark->getBookmarkType()); -+ -+ // have to cache the name, since we will need to use it for a while -+ // after the associated PT fragment has been deleted. -+ strncpy(m_pName, m_pBookmark->getName(), BOOKMARK_NAME_SIZE); -+ m_pName[BOOKMARK_NAME_SIZE] = 0; -+ -+ _setWidth(0); -+ _setRecalcWidth(false); -+} -+ -+bool fp_BookmarkRun::isComrade(fp_BookmarkRun *pBR) const -+{ -+ UT_ASSERT(m_pName && *m_pName && pBR->m_pName && *pBR->m_pName); -+ return (0 == strcmp(m_pName, pBR->m_pName)); -+} -+ -+void fp_BookmarkRun::_lookupProperties(const PP_AttrProp * /*pSpanAP*/, -+ const PP_AttrProp * /*pBlockAP*/, -+ const PP_AttrProp * /*pSectionAP*/, -+ GR_Graphics *) -+{ -+} -+ -+bool fp_BookmarkRun::canBreakAfter(void) const -+{ -+ return true; -+} -+ -+bool fp_BookmarkRun::canBreakBefore(void) const -+{ -+ return true; -+} -+ -+bool fp_BookmarkRun::_letPointPass(void) const -+{ -+ return true; -+} -+ -+bool fp_BookmarkRun::_canContainPoint(void) const -+{ -+ return false; -+} -+ -+bool fp_BookmarkRun::_deleteFollowingIfAtInsPoint() const -+{ -+ return true; -+} -+ -+/*! -+ When working with bookmarks, the run block offset does not always adequately represent the -+ location of the bookmark. For example, if the user bookmarks the same place in the doc with -+ several bookmarks, the run offsets for each associated run will be different, but most of the -+ time we are interested in the offset to the left or right of all stacked up bookmarks. Similarly, -+ a bookmark that is immediately after a start of block needs to be treated in certain situations -+ as if the block strux was also sellected. This function implements the necessary logic. -+ -+ In general, when we jump to bookmarks, we go to the range in between the two bookmark -+ object. However, for purposes of TOCs, we are interested in the range that is just outside the -+ two objects. -+ -+ \parameter bAfter: indicates if we want offset to the right (true) or left (false) of the -+ bookmark -+ -+ \return: the return value is document offset of the bookmarked position -+*/ -+UT_uint32 fp_BookmarkRun::getBookmarkedDocPosition(bool bAfter) const -+{ -+ if(bAfter) -+ { -+ fp_Run * pRun = getNextRun(); -+ const fp_Run * pPrevRun = this; -+ -+ while(pRun) -+ { -+ switch (pRun->getType()) -+ { -+ case FPRUN_BOOKMARK: -+ case FPRUN_FMTMARK: -+ pPrevRun = pRun; -+ pRun = pRun->getNextRun(); -+ break; -+ -+ default: -+ return getBlock()->getPosition(false) + pRun->getBlockOffset(); -+ } -+ } -+ -+ UT_ASSERT_HARMLESS( !pRun ); -+ return getBlock()->getPosition(false) + pPrevRun->getBlockOffset() + pPrevRun->getLength(); -+ } -+ else -+ { -+ fp_Run * pRun = getPrevRun(); -+ -+ while(pRun) -+ { -+ switch (pRun->getType()) -+ { -+ case FPRUN_BOOKMARK: -+ case FPRUN_FMTMARK: -+ pRun = pRun->getPrevRun(); -+ break; -+ -+ default: -+ return getBlock()->getPosition(false) + pRun->getBlockOffset() + pRun->getLength(); -+ } -+ } -+ -+ UT_ASSERT_HARMLESS( !pRun ); -+ return getBlock()->getPosition(true); // offset of the block strux -+ } -+} -+ -+void fp_BookmarkRun::mapXYToPosition(UT_sint32 x, UT_sint32 y, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ fp_Run *pRun = getNextRun(); -+ UT_ASSERT(pRun); -+ pRun->mapXYToPosition(x, y, pos, bBOL, bEOL,isTOC); -+} -+ -+void fp_BookmarkRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ fp_Run * pRun = getNextRun(); -+ UT_ASSERT(pRun); -+ -+ pRun->findPointCoords(iOffset, x, y, x2, y2, height, bDirection); -+} -+ -+void fp_BookmarkRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+ -+ FV_View* pView = _getView(); -+ if(!pView || !pView->getShowPara()) -+ { -+ return; -+ } -+ -+ -+ UT_sint32 xoff = 0, yoff = 0; -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ -+ if(m_bIsStart) -+ Fill(getGraphics(), xoff, yoff, 4, 8); -+ else -+ Fill(getGraphics(),xoff - 4, yoff, 4, 8); -+ -+} -+ -+void fp_BookmarkRun::_draw(dg_DrawArgs* pDA) -+{ -+ GR_Graphics * pG = pDA->pG; -+ if (!(pG->queryProperties(GR_Graphics::DGP_SCREEN))){ -+ return; -+ } -+ -+ FV_View* pView = _getView(); -+ if(!pView || !pView->getShowPara()) -+ { -+ return; -+ } -+ -+ -+ UT_uint32 iRunBase = getBlock()->getPosition() + getBlockOffset(); -+ -+ UT_uint32 iSelAnchor = pView->getSelectionAnchor(); -+ UT_uint32 iPoint = pView->getPoint(); -+ -+ UT_uint32 iSel1 = UT_MIN(iSelAnchor, iPoint); -+ UT_uint32 iSel2 = UT_MAX(iSelAnchor, iPoint); -+ -+ UT_ASSERT(iSel1 <= iSel2); -+ -+ bool bIsSelected = false; -+ if (/* pView->getFocus()!=AV_FOCUS_NONE && */isInSelectedTOC() || (iSel1 <= iRunBase) && (iSel2 > iRunBase)) -+ bIsSelected = true; -+ -+ pG->setColor(_getView()->getColorShowPara()); -+ -+ -+ #define NPOINTS 4 -+ -+ UT_Point points[NPOINTS]; -+ -+ points[0].y = pDA->yoff; -+ -+ -+ if(m_bIsStart) -+ { -+ points[0].x = pDA->xoff - 4; -+ points[1].x = pDA->xoff; -+ } -+ else -+ { -+ points[0].x = pDA->xoff; -+ points[1].x = points[0].x - 4; -+ } -+ -+ points[1].y = points[0].y + 4; -+ -+ points[2].x = points[0].x; -+ points[2].y = points[0].y + 8; -+ -+ points[3].x = points[0].x; -+ points[3].y = points[0].y; -+ -+ UT_RGBColor clrShowPara(_getView()->getColorShowPara()); -+ -+ GR_Painter painter(pG); -+ painter.polygon(clrShowPara,points,NPOINTS); -+ #undef NPOINTS -+ -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+fp_HyperlinkRun::fp_HyperlinkRun( fl_BlockLayout* pBL, -+ UT_uint32 iOffsetFirst, -+ UT_uint32 /*iLen*/) -+ : fp_Run(pBL, iOffsetFirst, 1, FPRUN_HYPERLINK) -+{ -+ _setLength(1); -+ _setDirty(false); -+ _setWidth(0); -+ _setRecalcWidth(false); -+ -+ UT_ASSERT((pBL)); -+ _setDirection(UT_BIDI_WS); -+ -+ const PP_AttrProp * pAP = NULL; -+ -+ getSpanAP(pAP); -+ -+ const gchar * pTarget; -+ const gchar * pName; -+ bool bFound = false; -+ UT_uint32 k = 0; -+ -+ while(pAP->getNthAttribute(k++, pName, pTarget)) -+ { -+ bFound = (0 == g_ascii_strncasecmp(pName,"xlink:href",10)); -+ if(bFound) -+ break; -+ } -+ -+ // we have got to keep a local copy, since the pointer we get -+ // is to a potentially volatile location -+ if(bFound) -+ { -+ UT_uint32 iTargetLen = strlen(pTarget); -+ m_pTarget = new gchar [iTargetLen + 1]; -+ strncpy(m_pTarget, pTarget, iTargetLen + 1); -+ m_bIsStart = true; -+ //if this is a start of the hyperlink, we set m_pHyperlink to this, -+ //so that when a run gets inserted after this one, its m_pHyperlink is -+ //set correctly -+ _setHyperlink(this); -+ } -+ else -+ { -+ m_bIsStart = false; -+ m_pTarget = NULL; -+ _setHyperlink(NULL); -+ } -+ -+} -+ -+ -+fp_HyperlinkRun::~fp_HyperlinkRun() -+{ -+ if(m_pTarget) -+ delete [] m_pTarget; -+} -+ -+void fp_HyperlinkRun::_lookupProperties(const PP_AttrProp * /*pSpanAP*/, -+ const PP_AttrProp * /*pBlockAP*/, -+ const PP_AttrProp * /*pSectionAP*/, -+ GR_Graphics *) -+{ -+} -+ -+bool fp_HyperlinkRun::canBreakAfter(void) const -+{ -+ return false; -+} -+ -+bool fp_HyperlinkRun::canBreakBefore(void) const -+{ -+ return true; -+} -+ -+bool fp_HyperlinkRun::_letPointPass(void) const -+{ -+ return true; -+} -+ -+bool fp_HyperlinkRun::_canContainPoint(void) const -+{ -+ return false; -+} -+ -+bool fp_HyperlinkRun::_deleteFollowingIfAtInsPoint() const -+{ -+ return true; -+} -+ -+void fp_HyperlinkRun::mapXYToPosition(UT_sint32 x, UT_sint32 y, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ fp_Run *pRun = getNextRun(); -+ UT_ASSERT(pRun); -+ pRun->mapXYToPosition(x, y, pos, bBOL, bEOL,isTOC); -+} -+ -+void fp_HyperlinkRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ fp_Run * pRun = getNextRun(); -+ UT_ASSERT(pRun); -+ -+ pRun->findPointCoords(iOffset, x, y, x2, y2, height, bDirection); -+} -+ -+void fp_HyperlinkRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+} -+ -+void fp_HyperlinkRun::_draw(dg_DrawArgs* /*pDA*/) -+{ -+} -+ -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+fp_EndOfParagraphRun::fp_EndOfParagraphRun(fl_BlockLayout* pBL, -+ UT_uint32 iOffsetFirst, -+ UT_uint32 iLen) -+ : fp_Run(pBL, iOffsetFirst, iLen, FPRUN_ENDOFPARAGRAPH) -+{ -+ -+ _setLength(1); -+ _setDirty(true); -+ xxx_UT_DEBUGMSG(("fp_EndOfParagraphRun::created this %x block %x \n",this,getBlock())); -+ -+ UT_ASSERT((pBL)); -+ _setDirection(pBL->getDominantDirection()); -+ lookupProperties(); -+} -+ -+ -+bool fp_EndOfParagraphRun::_recalcWidth(void) -+{ -+ return false; -+} -+ -+void fp_EndOfParagraphRun::_lookupProperties(const PP_AttrProp * pSpanAP, -+ const PP_AttrProp * pBlockAP, -+ const PP_AttrProp * pSectionAP, -+ GR_Graphics * pG) -+{ -+ xxx_UT_DEBUGMSG(("fp_EndOfParagraphRun::lookupProperties this %x block %x \n",this,getBlock())); -+ _inheritProperties(); -+ xxx_UT_DEBUGMSG(("After Inherit props Height is %d \n",getHeight())); -+ const gchar* pRevision = NULL; -+ -+ if(pBlockAP && pBlockAP->getAttribute("revision", pRevision)) -+ { -+ // we will not in fact be doing anything with the actual -+ // properties and attributes contained in the revision -+ // we just need its representation so the base class can -+ // handle us properly -+ PP_RevisionAttr * pRev = getRevisions(); -+ -+ if(pRev) -+ delete pRev; -+ -+ _setRevisions(new PP_RevisionAttr(pRevision)); -+ } -+ -+ FV_View* pView = _getView(); -+ if(pG == NULL) -+ { -+ pG = getGraphics(); -+ } -+ if (pView && pView->getShowPara()) -+ { -+ // Find width of Pilcrow -+ UT_UCSChar pEOP[] = { UCS_PILCROW, 0 }; -+ UT_uint32 iTextLen = UT_UCS4_strlen(pEOP); -+ -+ fp_Run* pPropRun = _findPrevPropertyRun(); -+ if (pPropRun && (FPRUN_TEXT == pPropRun->getType())) -+ { -+ fp_TextRun* pTextRun = static_cast(pPropRun); -+ pG->setFont(pTextRun->getFont()); -+ } -+ else -+ { -+ // look for fonts in this DocLayout's font cache -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ -+ const GR_Font * pFont = pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,getGraphics()); -+ pG->setFont(pFont); -+ } -+ m_iDrawWidth = pG->measureString(pEOP, 0, iTextLen, NULL); -+ xxx_UT_DEBUGMSG(("fp_EndOfParagraphRun::lookupProperties: width %d\n", getWidth())); -+ } -+ else -+ { -+ // FIXME:jskov This should probably be the width of the -+ // document to the right of the pilcrow, see Paul's suggested -+ // selection behaviors. Doesn't matter until we get selection -+ // support though (which requires PT changes). -+ -+ // I have changed this to 0, because otherwise it figures in -+ // calculation of line width, and the last line in righ-aligned -+ // paragraphs is shifted by the width of the pilcrow. -+ // this required some additional changes to the _draw function -+ // Tomas -+ m_iDrawWidth = 0; -+ } -+} -+ -+bool fp_EndOfParagraphRun::canBreakAfter(void) const -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ -+ return false; -+} -+ -+bool fp_EndOfParagraphRun::canBreakBefore(void) const -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ -+ return false; -+} -+ -+bool fp_EndOfParagraphRun::_letPointPass(void) const -+{ -+ return false; -+} -+ -+void fp_EndOfParagraphRun::mapXYToPosition(UT_sint32 /* x */, UT_sint32 /*y*/, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ pos = getBlock()->getPosition() + getBlockOffset(); -+ bBOL = false; -+ bEOL = true; -+} -+ -+void fp_EndOfParagraphRun::findPointCoords(UT_uint32 iOffset, -+ UT_sint32& x, UT_sint32& y, -+ UT_sint32& x2, UT_sint32& y2, -+ UT_sint32& height, -+ bool& bDirection) -+{ -+ // FIXME:jskov Find out why we are sometimes asked to find pos at -+ // right of pilcrow. Should never ever happen... But does. -+ // fjsdkjfklsdsdfsdsd move cursor back -+ // UT_ASSERT(getBlockOffset() == iOffset); -+ -+ fp_Run* pPropRun = _findPrevPropertyRun(); -+ -+ height = getHeight(); -+ if(pPropRun && pPropRun->getType() == FPRUN_IMAGE) -+ { -+ height = static_cast(pPropRun)->getPointHeight(); -+ } -+ xxx_UT_DEBUGMSG((" Got initial height of %d \n",height)); -+ if (pPropRun) -+ { -+ xxx_UT_DEBUGMSG(("Got propRun in EOPRun \n")); -+ height = pPropRun->getHeight(); -+ if(pPropRun->getType() == FPRUN_IMAGE) -+ { -+ height = static_cast(pPropRun)->getPointHeight(); -+ } -+ -+ // If property Run is on the same line, get y location from -+ // it (to reflect proper ascent). -+ if (pPropRun->getLine() == getLine()) -+ { -+ pPropRun->findPointCoords(iOffset, x, y, x2, y2, height, bDirection); -+ xxx_UT_DEBUGMSG(("Got propRun in EOPRun inherited height %d \n",height)); -+ if(pPropRun->getType() == FPRUN_IMAGE) -+ { -+ height = static_cast(pPropRun)->getPointHeight(); -+ } -+ return; -+ } -+ } -+ xxx_UT_DEBUGMSG((" Got final height of %d \n",height)); -+ -+ getLine()->getOffsets(this, x, y); -+ x2 = x; -+ y2 = y; -+} -+ -+void fp_EndOfParagraphRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+ // UT_ASSERT(!isDirty()); -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+ if(m_iDrawWidth == 0 ) -+ { -+ return; -+ } -+ UT_sint32 xoff = 0, yoff = 0; -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ -+ if(getBlock()->getDominantDirection() == UT_BIDI_RTL) -+ { -+ xoff -= m_iDrawWidth; -+ } -+ Fill(getGraphics(),xoff, yoff+1, m_iDrawWidth, getLine()->getHeight()+1); -+} -+ -+/*! -+ Draw end-of-paragraph Run graphical representation -+ \param pDA Draw arguments -+ Draws the pilcrow character (reverse P) in show paragraphs mode. -+ \fixme Make it use the same typeface as preceding text. -+ \note This _draw function is special in that it does (partly) lookup -+ as well. That's because the pilcrow's typeface is controlled by the -+ preceding character. Eventually, when the PT learns about EOP, it -+ should be possible to just deal with this in the lookup function. -+*/ -+void fp_EndOfParagraphRun::_draw(dg_DrawArgs* pDA) -+{ -+ // if showPara is turned off we will not draw anything at all; however, -+ // we will ensure that the width is set to 0, and if it is currently not -+ // we will get our line to redo its layout and redraw. -+ FV_View* pView = _getView(); -+ if(!pView || !pView->getShowPara()) -+ { -+ if(m_iDrawWidth) -+ { -+ m_iDrawWidth = 0; -+ //getLine()->layout(); -+ //getLine()->redrawUpdate(); -+ } -+ return; -+ } -+ -+ UT_uint32 iRunBase = getBlock()->getPosition() + getBlockOffset(); -+ -+ UT_uint32 iSelAnchor = pView->getSelectionAnchor(); -+ UT_uint32 iPoint = pView->getPoint(); -+ -+ UT_uint32 iSel1 = UT_MIN(iSelAnchor, iPoint); -+ UT_uint32 iSel2 = UT_MAX(iSelAnchor, iPoint); -+ -+ UT_ASSERT(iSel1 <= iSel2); -+ -+ bool bIsSelected = false; -+ if (/* pView->getFocus()!=AV_FOCUS_NONE && */isInSelectedTOC() || (iSel1 <= iRunBase) && (iSel2 > iRunBase)) -+ bIsSelected = true; -+ -+ GR_Painter painter(getGraphics()); -+ -+ UT_UCSChar pEOP[] = { UCS_PILCROW, 0 }; -+ UT_uint32 iTextLen = UT_UCS4_strlen(pEOP); -+ UT_sint32 iAscent; -+ -+ fp_Run* pPropRun = _findPrevPropertyRun(); -+ if (pPropRun && (FPRUN_TEXT == pPropRun->getType())) -+ { -+ fp_TextRun* pTextRun = static_cast(pPropRun); -+ getGraphics()->setFont(pTextRun->getFont()); -+ iAscent = pTextRun->getAscent(); -+ } -+ else -+ { -+ const PP_AttrProp * pSpanAP = NULL; -+ const PP_AttrProp * pBlockAP = NULL; -+ const PP_AttrProp * pSectionAP = NULL; -+ -+ getSpanAP(pSpanAP); -+ getBlockAP(pBlockAP); -+ -+ // look for fonts in this DocLayout's font cache -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ -+ const GR_Font * pFont = pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,getGraphics()); -+ getGraphics()->setFont(pFont); -+ iAscent = getGraphics()->getFontAscent(); -+ } -+ -+ // if we currently have a 0 width, i.e., we draw in response to the -+ // showPara being turned on, then we obtain the new width, and then -+ // tell the line to redo its layout and redraw instead of drawing ourselves -+// bool bWidthChange = false; -+// if(!m_iDrawWidth) -+// bWidthChange = true; -+ -+ m_iDrawWidth = getGraphics()->measureString(pEOP, 0, iTextLen, NULL); -+// if(bWidthChange) -+// { -+// getLine()->layout(); -+// getLine()->redrawUpdate(); -+// return; -+// } -+ -+ _setHeight(getGraphics()->getFontHeight()); -+ m_iXoffText = pDA->xoff; -+ -+ if(getBlock()->getDominantDirection() == UT_BIDI_RTL) -+ { -+ m_iXoffText -= m_iDrawWidth; -+ } -+ -+ m_iYoffText = pDA->yoff - iAscent; -+ xxx_UT_DEBUGMSG(("fp_EndOfParagraphRun::draw: width %d\n", m_iDrawWidth)); -+ -+ if (bIsSelected) -+ { -+ painter.fillRect(_getView()->getColorSelBackground(), m_iXoffText, m_iYoffText, m_iDrawWidth, getLine()->getHeight()); -+ } -+ else -+ { -+ Fill(getGraphics(),m_iXoffText, m_iYoffText, m_iDrawWidth, getLine()->getHeight()); -+ } -+ if (getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN) && pView->getShowPara()) -+ { -+ // Draw pilcrow -+ // use the hard-coded colour only if not revised -+ if(!getRevisions() || !pView->isShowRevisions()) -+ getGraphics()->setColor(pView->getColorShowPara()); -+ painter.drawChars(pEOP, 0, iTextLen, m_iXoffText, m_iYoffText); -+ } -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+ -+fp_ImageRun::fp_ImageRun(fl_BlockLayout* pBL, -+ UT_uint32 iOffsetFirst, -+ UT_uint32 iLen, FG_Graphic * pFG) : -+ fp_Run(pBL, iOffsetFirst, iLen, FPRUN_IMAGE), -+ m_pFGraphic(pFG), -+ m_iPointHeight(0), -+ m_pSpanAP(NULL), -+ m_bImageForPrinter (false) -+{ -+#if 0 // put this back later -+ UT_ASSERT(pImage); -+#endif -+ -+ m_pImage = pFG->generateImage(getGraphics(), NULL, 0, 0); -+ m_sCachedWidthProp = pFG->getWidthProp(); -+ m_sCachedHeightProp = pFG->getHeightProp(); -+ m_iGraphicTick = pBL->getDocLayout()->getGraphicTick(); -+ lookupProperties(); -+} -+ -+fp_ImageRun::~fp_ImageRun() -+{ -+ if (m_pImage) -+ { -+ delete m_pImage; -+ } -+ if(m_pFGraphic) -+ { -+ delete m_pFGraphic; -+ } -+} -+ -+void fp_ImageRun::regenerateImage(GR_Graphics * pG) -+{ -+ DELETEP(m_pImage); -+ m_pImage = m_pFGraphic->regenerateImage(pG); -+ m_bImageForPrinter = pG->queryProperties(GR_Graphics::DGP_PAPER); -+ m_iGraphicTick = getBlock()->getDocLayout()->getGraphicTick(); -+ -+} -+ -+void fp_ImageRun::_lookupProperties(const PP_AttrProp * pSpanAP, -+ const PP_AttrProp * /*pBlockAP*/, -+ const PP_AttrProp * /*pSectionAP*/, -+ GR_Graphics * pG) -+{ -+ fd_Field * fd = NULL; -+ UT_return_if_fail(pSpanAP); -+ m_pSpanAP = pSpanAP; -+ getBlock()->getField(getBlockOffset(), fd); -+ _setField(fd); -+ const gchar * szWidth = NULL; -+ pSpanAP->getProperty("width", szWidth); -+ if(szWidth == NULL) -+ { -+ szWidth = "0in"; -+ } -+ const gchar * szHeight = NULL; -+ pSpanAP->getProperty("height", szHeight); -+ if(pG == NULL) -+ { -+ pG = getGraphics(); -+ } -+ if(szHeight == NULL) -+ { -+ szHeight = "0in"; -+ } -+ -+ // Also get max width, height ready for generateImage. -+ -+ fl_DocSectionLayout * pDSL = getBlock()->getDocSectionLayout(); -+ fp_Page * p = NULL; -+ if(pDSL->getFirstContainer()) -+ { -+ p = pDSL->getFirstContainer()->getPage(); -+ } -+ else -+ { -+ p = pDSL->getDocLayout()->getNthPage(0); -+ } -+ UT_sint32 maxW = static_cast(static_cast(pDSL->getActualColumnWidth())*0.95); -+ UT_sint32 maxH = static_cast(static_cast(pDSL->getActualColumnHeight())*0.95); -+ fl_ContainerLayout * pCL = getBlock()->myContainingLayout(); -+ if(pCL && pCL->getContainerType() == FL_CONTAINER_FRAME) -+ { -+ fl_FrameLayout * pFL = static_cast(pCL); -+ maxW = pFL->getFrameWidth(); -+ maxH = pFL->getFrameHeight(); -+ if(getLine()) -+ { -+ maxH -= getLine()->getY(); // take Y height into account. -+ } -+ } -+ else if (pCL && pCL->getContainerType() == FL_CONTAINER_CELL) -+ { -+ fl_CellLayout * pCell = static_cast(pCL); -+ maxW = static_cast(static_cast(maxW)*0.95); -+ maxH = static_cast(static_cast(maxH)*0.95); -+ if(pCell->getCellWidth() > pG->tlu(2) && pCell->getCellWidth() < maxW) -+ { -+ maxW = pCell->getCellWidth(); -+ } -+ } -+ if(pG->tdu(maxW) < 3) -+ { -+ maxW = pG->tlu(3); -+ } -+ if(pG->tdu(maxH) < 3) -+ { -+ maxH = pG->tlu(3); -+ } -+ UT_DEBUGMSG(("Image szWidth %s Image szHeight %s \n",szWidth,szHeight)); -+ if((pG->queryProperties(GR_Graphics::DGP_PAPER) != m_bImageForPrinter) || -+ (strcmp(m_sCachedWidthProp.c_str(),szWidth) != 0) || -+ (strcmp(m_sCachedHeightProp.c_str(),szHeight) != 0) || -+ UT_convertToLogicalUnits(szHeight) > maxH || -+ UT_convertToLogicalUnits(szWidth) > maxW) -+ { -+ m_sCachedWidthProp = szWidth; -+ m_sCachedHeightProp = szHeight; -+ DELETEP(m_pImage); -+ UT_sint32 iH = UT_convertToLogicalUnits(szHeight); -+ UT_sint32 iW = UT_convertToLogicalUnits(szWidth); -+ if((iW < maxW) && (iW > 30)) -+ { -+ maxW = iW; -+ UT_DEBUGMSG(("Change Image Width to %d \n",maxW)); -+ } -+ if((iH < maxH) && (iH > 30)) -+ { -+ maxH = iH; -+ UT_DEBUGMSG(("Change Image Height to %d \n",maxH)); -+ } -+ m_pImage = m_pFGraphic->generateImage(pG, pSpanAP, maxW, maxH); -+ m_bImageForPrinter = pG->queryProperties(GR_Graphics::DGP_PAPER); -+ markAsDirty(); -+ if(getLine()) -+ { -+ getLine()->setNeedsRedraw(); -+ } -+ } -+ if (m_pImage) -+ { -+ _setWidth(pG->tlu(m_pImage->getDisplayWidth())); -+ _setHeight(pG->tlu(m_pImage->getDisplayHeight())); -+ } -+ else -+ { -+ // If we have no image, we simply insert a square "slug" -+ -+ _setWidth(UT_convertToLogicalUnits("0.5in")); -+ _setHeight(UT_convertToLogicalUnits("0.5in")); -+ } -+ -+ // these asserts are no longer valid -- image can be hidden due to -+ //hidden text mark up or revisions -+ //UT_ASSERT(getWidth() > 0); -+ //UT_ASSERT(getHeight() > 0); -+ m_iImageWidth = getWidth(); -+ m_iImageHeight = getHeight(); -+ -+ _setAscent(_getHeight()); -+ _setDescent(0); -+ const PP_AttrProp * pBlockAP = NULL; -+ const PP_AttrProp * pSectionAP = NULL; -+ -+ getBlockAP(pBlockAP); -+ -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ const GR_Font * pFont = pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,getGraphics()); -+ -+ if (pFont != _getFont()) -+ { -+ _setFont(pFont); -+ } -+ m_iPointHeight = pG->getFontAscent(pFont) + getGraphics()->getFontDescent(pFont); -+} -+ -+bool fp_ImageRun::canBreakAfter(void) const -+{ -+ return true; -+} -+ -+bool fp_ImageRun::canBreakBefore(void) const -+{ -+ return true; -+} -+ -+bool fp_ImageRun::_letPointPass(void) const -+{ -+ return false; -+} -+ -+bool fp_ImageRun::hasLayoutProperties(void) const -+{ -+ return true; -+} -+ -+void fp_ImageRun::mapXYToPosition(UT_sint32 x, UT_sint32 /*y*/, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ if (x > getWidth()) -+ pos = getBlock()->getPosition() + getBlockOffset() + getLength(); -+ else -+ pos = getBlock()->getPosition() + getBlockOffset(); -+ -+ bBOL = false; -+ bEOL = false; -+} -+ -+void fp_ImageRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ //UT_DEBUGMSG(("fintPointCoords: ImmageRun\n")); -+ UT_sint32 xoff; -+ UT_sint32 yoff; -+ -+ UT_ASSERT(getLine()); -+ -+ getLine()->getOffsets(this, xoff, yoff); -+ if (iOffset == (getBlockOffset() + getLength())) -+ { -+ x = xoff + getWidth(); -+ x2 = x; -+ } -+ else -+ { -+ x = xoff; -+ x2 = x; -+ } -+ y = yoff + getHeight() - m_iPointHeight; -+ height = m_iPointHeight; -+ y2 = y; -+ bDirection = (getVisDirection() != UT_BIDI_LTR); -+} -+ -+void fp_ImageRun::_clearScreen(bool bFullLineHeightRect ) -+{ -+ // UT_ASSERT(!isDirty()); -+ -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+ -+ UT_sint32 xoff = 0, yoff = 0; -+ -+ // need to clear full height of line, in case we had a selection -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ UT_sint32 iLineHeight = getLine()->getHeight(); -+ Fill(getGraphics(),xoff, yoff, getWidth(), iLineHeight); -+ markAsDirty(); -+ setCleared(); -+} -+ -+const char * fp_ImageRun::getDataId(void) const -+{ -+ return m_pFGraphic->getDataId(); -+} -+ -+void fp_ImageRun::_draw(dg_DrawArgs* pDA) -+{ -+ GR_Graphics *pG = pDA->pG; -+ if(getBlock()->getDocLayout()->getGraphicTick() != m_iGraphicTick) -+ { -+ regenerateImage(pG); -+ } -+ else if(!pG->queryProperties(GR_Graphics::DGP_SCREEN)) -+ { -+ regenerateImage(pG); -+ m_iGraphicTick = getBlock()->getDocLayout()->getGraphicTick()+999; -+ } -+ UT_sint32 xoff = 0, yoff = 0; -+ -+ if(pG->queryProperties(GR_Graphics::DGP_SCREEN)) -+ { -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ } -+ else -+ { -+ getLine()->getOffsets(this, xoff, yoff); -+ if(_getView()->getViewMode() != VIEW_PRINT) -+ { -+ yoff += static_cast(getBlock()->getDocSectionLayout())->getTopMargin(); -+ } -+ } -+ -+ yoff += getLine()->getAscent() - getAscent() + 1; -+ -+ // clip drawing to the page -+ UT_Rect pClipRect; -+ pClipRect.top = yoff; -+ pClipRect.left = xoff; -+ pClipRect.height = getLine()->getContainer()->getHeight(); -+ pClipRect.width = getLine()->getContainer()->getWidth(); -+ pClipRect.height -= getLine()->getY(); -+ // -+ // SEVIOR Says don't touch this if statement unless you know how to make windows -+ // and gnome-print print images. Otherwise your commit priviliges will be revoked. -+ // -+ const UT_Rect * pSavedRect = NULL; -+ if(pG->getClipRect()) -+ { -+ pSavedRect = pG->getClipRect(); -+ } -+ if(pG->queryProperties(GR_Graphics::DGP_SCREEN)) -+ { -+ // -+ // Take the interesction of the applied rectangle; -+ if(pSavedRect != NULL) -+ { -+ UT_sint32 iTop,iLeft,iWidth,iHeight; -+ iTop = 0; -+ iLeft = 0; -+ iWidth = 0; -+ iHeight = 0; -+ iTop = pClipRect.top; -+ if(pSavedRect->top > pClipRect.top) -+ { -+ iTop = pSavedRect->top; -+ } -+ UT_sint32 iBot = pClipRect.top + pClipRect.height; -+ if((pSavedRect->top + pSavedRect->height) < (pClipRect.top + pClipRect.height)) -+ { -+ iBot = pSavedRect->top + pSavedRect->height; -+ } -+ iHeight = iBot - iTop; -+ if(iHeight < pG->tlu(1)) -+ { -+ iHeight = pG->tlu(2); -+ } -+ iLeft = pClipRect.left; -+ if(pSavedRect->left > pClipRect.left) -+ { -+ iLeft = pSavedRect->left; -+ } -+ UT_sint32 iRight = pClipRect.left + pClipRect.width; -+ if((pSavedRect->left + pSavedRect->width) < (pClipRect.left + pClipRect.width)) -+ { -+ iRight = pSavedRect->left + pSavedRect->width; -+ } -+ iWidth = iRight - iLeft; -+ if(iWidth < pG->tlu(1)) -+ { -+ iWidth = pG->tlu(2); -+ } -+ pClipRect.left = iLeft; -+ pClipRect.width = iWidth; -+ pClipRect.top = iTop; -+ pClipRect.height = iHeight; -+ pG->setClipRect(&pClipRect); -+ } -+ -+ } -+ -+ FV_View* pView = _getView(); -+ -+ GR_Painter painter(pG); -+ -+ if (m_pImage) -+ { -+ // draw the image (always) -+ xxx_UT_DEBUGMSG(("SEVIOR: Drawing image now \n")); -+ painter.drawImage(m_pImage, xoff, yoff); -+ -+ // if we're the selection, draw some pretty selection markers -+ if (pG->queryProperties(GR_Graphics::DGP_SCREEN)) -+ { -+ UT_uint32 iRunBase = getBlock()->getPosition() + getBlockOffset(); -+ -+ UT_uint32 iSelAnchor = pView->getSelectionAnchor(); -+ UT_uint32 iPoint = pView->getPoint(); -+ -+ UT_uint32 iSel1 = UT_MIN(iSelAnchor, iPoint); -+ UT_uint32 iSel2 = UT_MAX(iSelAnchor, iPoint); -+ -+ UT_ASSERT(iSel1 <= iSel2); -+ -+ if ( -+ /* pView->getFocus()!=AV_FOCUS_NONE && */ -+ (iSel1 <= iRunBase) -+ && (iSel2 > iRunBase) -+ ) -+ { -+ UT_uint32 top = yoff; -+ UT_uint32 left = xoff; -+ UT_uint32 right = xoff + getWidth() - pG->tlu(1); -+ UT_uint32 bottom = yoff + getHeight() - pG->tlu(1); -+ -+ UT_Rect box(left, top, right - left, bottom - top); -+ pView->drawSelectionBox(box, true); -+ } -+ } -+ -+ } -+ else -+ { -+ painter.fillRect(pView->getColorImage(), xoff, yoff, getWidth(), getHeight()); -+ } -+ -+ // unf*ck clipping rect -+ pG->setClipRect(pSavedRect); -+} -+ -+GR_Image * fp_ImageRun::getImage() -+{ -+ return m_pImage; -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+#define _FIELD(type,desc,tag) /*nothing*/ -+#define _FIELDTYPE(type,desc) {FPFIELDTYPE_##type, NULL, desc}, -+ -+fp_FieldTypeData fp_FieldTypes[] = { -+ -+#include "fp_Fields.h" -+ -+ {FPFIELDTYPE_END, NULL, 0} }; -+ -+#undef _FIELD -+#undef _FIELDTYPE -+ -+// The way to turn macro argument into string constant -+#define xstr2(x) #x -+#define xstr(x) xstr2(x) -+#define _FIELD(type,desc,tag) {FPFIELDTYPE_##type, FPFIELD_##tag, NULL, xstr(tag), desc}, -+#define _FIELDTYPE(type,desc) /*nothing*/ -+ -+fp_FieldData fp_FieldFmts[] = { -+ -+#include "fp_Fields.h" -+ -+ {FPFIELDTYPE_END, FPFIELD_end, NULL, NULL, 0} }; -+ -+#undef xstr2 -+#undef xstr -+#undef _FIELD -+#undef _FIELDTYPE -+ -+fp_FieldRun::fp_FieldRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) -+ : fp_Run(pBL, iOffsetFirst, iLen, FPRUN_FIELD), -+ m_iFieldType(FPFIELD_start), -+ m_pParameter(0), -+ m_fPosition(TEXT_POSITION_NORMAL) -+{ -+ fd_Field * fd; -+ lookupProperties(); -+ if(!getBlock()->isContainedByTOC()) -+ { -+ bool gotField = pBL->getField(iOffsetFirst,fd); -+ if(gotField) -+ { -+ _setField(fd); -+ } -+ } -+ // UT_ASSERT(gotField); -+ m_sFieldValue[0] = 0; -+} -+ -+fp_FieldRun::~fp_FieldRun(void) -+{ -+ xxx_UT_DEBUGMSG(("FieldRun deleted %x FieldType %d \n",this,getFieldType())); -+ return; -+} -+ -+bool fp_FieldRun::_recalcWidth() -+{ -+ // TODO -- is this really needed ??? -+ // this should not be needed, since lookup properties is called -+ // when formatting changes - Tomas -+ //lookupProperties(); -+ -+ getGraphics()->setFont(_getFont()); -+ UT_sint32 iNewWidth = 0; -+ if(UT_UCS4_strlen(m_sFieldValue) > 0) -+ { -+ iNewWidth = getGraphics()->measureString(m_sFieldValue, -+ 0, -+ UT_UCS4_strlen(m_sFieldValue), -+ NULL); -+ } -+ if (iNewWidth != getWidth()) -+ { -+ clearScreen(); -+ markAsDirty(); -+ if(getLine()) -+ { -+ getLine()->setNeedsRedraw(); -+ } -+ if(getBlock()) -+ { -+ getBlock()->setNeedsRedraw(); -+ } -+ _setWidth(iNewWidth); -+ -+ return true; -+ } -+ -+ return false; -+} -+ -+bool fp_FieldRun::_setValue(const UT_UCSChar *p_new_value) -+{ -+ if (0 != UT_UCS4_strcmp(p_new_value, m_sFieldValue)) -+ { -+ xxx_UT_DEBUGMSG(("fp_FieldRun::_setValue: setting new value\n")); -+ clearScreen(); -+ markAsDirty(); -+ if(getLine()) -+ { -+ getLine()->setNeedsRedraw(); -+ } -+ if(getBlock()) -+ { -+ getBlock()->setNeedsRedraw(); -+ } -+ -+ markDrawBufferDirty(); -+ UT_uint32 iLen = UT_UCS4_strlen(p_new_value); -+ iLen = UT_MIN(iLen,FPFIELD_MAX_LENGTH); -+ -+ if(iLen > 1 && XAP_App::getApp()->theOSHasBidiSupport() == XAP_App::BIDI_SUPPORT_GUI) -+ { -+ UT_BidiCharType prevType, myType; -+ -+ if(getPrevRun()) -+ prevType = getPrevRun()->getVisDirection(); -+ else -+ prevType = getBlock()->getDominantDirection(); -+ -+ myType = prevType; -+ UT_bidiReorderString(p_new_value, iLen, myType, m_sFieldValue); -+ -+ m_sFieldValue[iLen] = 0; -+ } -+ else -+ { -+ UT_UCS4_strcpy(m_sFieldValue, p_new_value); -+ } -+ -+ { -+ // TODO -- is this really needed??? -+ // should not be, since lookupProperties is called on -+ // formatting changes - Tomas -+ // lookupProperties(); -+ -+ getGraphics()->setFont(_getFont()); -+ -+ UT_sint32 iNewWidth = -+ getGraphics()->measureString(m_sFieldValue, -+ 0, -+ UT_UCS4_strlen(m_sFieldValue), -+ NULL); -+ if (iNewWidth != getWidth()) -+ { -+ _setWidth(iNewWidth); -+ markWidthDirty(); -+ return true; -+ } -+ -+ } -+ } -+ xxx_UT_DEBUGMSG(("fp_FieldRun::_setValue: value has not changed [0] %x \n", m_sFieldValue[0])); -+ -+ return false; -+} -+ -+void fp_FieldRun::_lookupProperties(const PP_AttrProp * pSpanAP, -+ const PP_AttrProp * pBlockAP, -+ const PP_AttrProp * pSectionAP, -+ GR_Graphics * pG) -+{ -+ if(pG == NULL) -+ { -+ pG = getGraphics(); -+ } -+ PD_Document * pDoc = getBlock()->getDocument(); -+ fd_Field * fd = NULL; -+ if(!getBlock()->isContainedByTOC()) -+ { -+ getBlock()->getField(getBlockOffset() /*+1*/,fd); // Next Pos? -+ _setField(fd); -+ } -+ else -+ { -+ _setField(NULL); -+ } -+ if(getField() != NULL) -+ { -+ getField()->setBlock(getBlock()); -+ } -+ // look for fonts in this DocLayout's font cache -+ FL_DocLayout * pLayout = getBlock()->getDocLayout(); -+ -+ UT_RGBColor clrFG; -+ UT_parseColor(PP_evalProperty("color",pSpanAP,pBlockAP,pSectionAP, getBlock()->getDocument(), true), clrFG); -+ _setColorFG(clrFG); -+ -+ const char * pszFieldColor = NULL; -+ pszFieldColor = PP_evalProperty("field-color",pSpanAP,pBlockAP,pSectionAP, getBlock()->getDocument(), true); -+ -+ const char * pszBGColor = NULL; -+ pszBGColor = PP_evalProperty("bgcolor",pSpanAP,pBlockAP,pSectionAP, getBlock()->getDocument(), true); -+ -+// -+// FIXME: The "ffffff" is for backwards compatibility. If we don't exclude this -+// no prexisting docs will be able to change the Highlight color in paragraphs -+// with lists. I think this is a good solution for now. However it does mean -+// field-color of "ffffff", pure white is actually transparent. -+// -+ if(pszFieldColor && strcmp(pszFieldColor,"transparent") != 0 && strcmp(pszFieldColor,"ffffff" ) != 0 && pG->queryProperties(GR_Graphics::DGP_SCREEN)) -+ { -+ UT_RGBColor r; -+ UT_parseColor(pszFieldColor, r); -+ _setColorHL(r); -+ } -+ else if (pszBGColor && strcmp(pszFieldColor,"transparent") != 0) -+ { -+ UT_RGBColor r; -+ UT_parseColor(pszBGColor, r); -+ _setColorHL(r); -+ } -+ -+ -+ const gchar* pszType = NULL; -+ const gchar* pszParam = NULL; -+ -+ if(pSpanAP) -+ { -+ pSpanAP->getAttribute("type", pszType); -+ pSpanAP->getAttribute("param", pszParam); -+ } -+ else -+ { -+ pBlockAP->getAttribute("type",pszType); -+ pBlockAP->getAttribute("param", pszParam); -+ } -+ -+ if(pszParam) -+ m_pParameter = pszParam; -+ -+ // i leave this in because it might be obscuring a larger bug -+ //UT_ASSERT(pszType); -+ if (!pszType) return; -+ -+ int i; -+ if(pszType != NULL) -+ { -+ for( i = 0; fp_FieldFmts[i].m_Tag != NULL; i++ ) -+ { -+ if (0 == strcmp(pszType, fp_FieldFmts[i].m_Tag)) -+ { -+ m_iFieldType = fp_FieldFmts[i].m_Num; -+ break; -+ } -+ } -+ if( fp_FieldFmts[i].m_Tag == NULL ) -+ { -+ // probably new type of field -+ // UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ } -+ } -+ -+ xxx_UT_DEBUGMSG(("FieldRun: Lookup Properties field type %d \n",m_iFieldType)); -+ if(m_iFieldType == FPFIELD_list_label) -+ { -+ _setFont(pLayout->findFont(pSpanAP,pBlockAP,pSectionAP,pG, true)); -+ } -+ else -+ { -+ _setFont(pLayout->findFont(pSpanAP,pBlockAP,pSectionAP, pG)); -+ } -+ -+ _setAscent(pG->getFontAscent(_getFont())); -+ _setDescent(pG->getFontDescent(_getFont())); -+ _setHeight(pG->getFontHeight(_getFont())); -+ -+ const gchar * pszPosition = PP_evalProperty("text-position",pSpanAP,pBlockAP,pSectionAP, pDoc, true); -+ -+ if (0 == strcmp(pszPosition, "superscript")) -+ { -+ m_fPosition = TEXT_POSITION_SUPERSCRIPT; -+ } -+ else if (0 == strcmp(pszPosition, "subscript")) -+ { -+ m_fPosition = TEXT_POSITION_SUBSCRIPT; -+ } -+ else -+ { -+ m_fPosition = TEXT_POSITION_NORMAL; -+ } -+// -+// Lookup Decoration properties for this run -+// -+ const gchar *pszDecor = PP_evalProperty("text-decoration",pSpanAP,pBlockAP,pSectionAP, getBlock()->getDocument(), true); -+ _setLineWidth(getToplineThickness()); -+ _setDecorations(0); -+ gchar* p; -+ if (!(p = g_strdup(pszDecor))) -+ { -+ // TODO outofmem -+ } -+ UT_ASSERT(p || !pszDecor); -+ gchar* q = strtok(p, " "); -+ -+ while (q) -+ { -+ if (0 == strcmp(q, "underline")) -+ { -+ _orDecorations(TEXT_DECOR_UNDERLINE); -+ } -+ else if (0 == strcmp(q, "overline")) -+ { -+ _orDecorations(TEXT_DECOR_OVERLINE); -+ } -+ else if (0 == strcmp(q, "line-through")) -+ { -+ _orDecorations(TEXT_DECOR_LINETHROUGH); -+ } -+ else if (0 == strcmp(q, "topline")) -+ { -+ _orDecorations(TEXT_DECOR_TOPLINE); -+ } -+ else if (0 == strcmp(q, "bottomline")) -+ { -+ _orDecorations(TEXT_DECOR_BOTTOMLINE); -+ } -+ q = strtok(NULL, " "); -+ } -+ -+ g_free(p); -+} -+ -+ -+fp_FieldsEnum fp_FieldRun::getFieldType(void) const -+{ -+ return m_iFieldType; -+} -+ -+bool fp_FieldRun::canBreakAfter(void) const -+{ -+ return true; -+} -+ -+bool fp_FieldRun::canBreakBefore(void) const -+{ -+ return true; -+} -+ -+bool fp_FieldRun::_letPointPass(void) const -+{ -+ return true; -+} -+ -+bool fp_FieldRun::isSuperscript(void) const -+{ -+ return (m_fPosition == TEXT_POSITION_SUPERSCRIPT); -+} -+ -+bool fp_FieldRun::isSubscript(void) const -+{ -+ return (m_fPosition == TEXT_POSITION_SUBSCRIPT); -+} -+ -+bool fp_FieldRun::hasLayoutProperties(void) const -+{ -+ return true; -+} -+ -+void fp_FieldRun::mapXYToPosition(UT_sint32 x, UT_sint32 /*y*/, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ // If X is left of the middle, return offset to the left, -+ // otherwise the offset to the right. -+ if (x < (getWidth() / 2)) -+ pos = getBlock()->getPosition() + getBlockOffset(); -+ else -+ pos = getBlock()->getPosition() + getBlockOffset() + getLength(); -+ -+ bBOL = false; -+ if(getNextRun() == NULL) -+ { -+ bEOL = true; -+ } -+ if(getNextRun()->getType() == FPRUN_ENDOFPARAGRAPH) -+ { -+ bEOL = true; -+ } -+} -+ -+void fp_FieldRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, -+ UT_sint32& y, UT_sint32& x2, -+ UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ xxx_UT_DEBUGMSG(("findPointCoords: FieldRun offset %d \n",iOffset)); -+ UT_sint32 xoff; -+ UT_sint32 yoff; -+ -+ UT_ASSERT(getLine()); -+ -+ // TODO is this really needed ??? -+ // should not be, since lookupProperties is called on -+ // formatting changes - Tomas -+ // lookupProperties(); -+ -+ getLine()->getOffsets(this, xoff, yoff); -+ xxx_UT_DEBUGMSG(("findPointCoords: FieldRun orig yoff %d \n",yoff)); -+// -+// The footnote code is to handle discontinuities in offset from embedded -+// footnotes in blocks. -+// -+ bool bFootnote = false; -+ if (iOffset == (getBlockOffset() + getLength())) -+ { -+ xoff += getWidth(); -+ } -+ else if(iOffset > (getBlockOffset() + getLength())) -+ { -+ bFootnote = true; -+ xoff += getWidth(); -+ } -+ -+ if (!bFootnote && (m_fPosition == TEXT_POSITION_SUPERSCRIPT)) -+ { -+ yoff -= getAscent() * 1/2; -+ } -+ else if (!bFootnote && (m_fPosition == TEXT_POSITION_SUBSCRIPT)) -+ { -+ yoff += getDescent() /* * 3/2 */; -+ } -+ xxx_UT_DEBUGMSG(("findPointCoords: FieldRun yoff %d \n",yoff)); -+ x = xoff; -+ y = yoff; -+ if(!bFootnote) -+ { -+ height = getHeight(); -+ } -+ else -+ { -+// -+// We're actually just before the next run and in the insertion point will be -+// in the next run so make the insertion point reflect this. -+// -+ if(getNextRun() && getNextRun()->hasLayoutProperties() ) -+ { -+ height = getNextRun()->getHeight(); -+ UT_sint32 xx,xx2,yy2,hheight; -+ bool bbDirection; -+ getNextRun()->findPointCoords(iOffset+1,xx,y,xx2,yy2, hheight, -+ bbDirection); -+ height = hheight; -+ -+ } -+ else -+ { -+ height = getHeight(); -+ } -+ } -+ x2 = x; -+ y2 = y; -+ bDirection = (getVisDirection() != UT_BIDI_LTR); -+} -+ -+bool fp_FieldRun::calculateValue(void) -+{ -+ // -+ // Code for the Piece Table Fields Calculation -+ // Get size of the field from the following runs -+ // -+ // return getField()->update(); -+ // UT_ASSERT(getField()); -+ -+/* UT_sint32 count = 0; -+ fp_Run* pNext = getNextRun(); -+ while(pNext != NULL && pNext->getField() != NULL ) -+ { -+ if(getField() == NULL) -+ { -+ getField() = pNext->getField(); -+ } -+ pNext = getNextRun(); -+ count++; -+ } -+ if(count == 0) -+ { -+ setWidth(0); -+ _setHeight(0); -+ } -+ else -+ { -+ pNext = getPrevRun(); -+ setWidth(pNext->getWidth()); -+ _setHeight(pNext->getHeight()); -+ } -+ if(getField() != NULL) -+ getField()->update(); -+*/ -+ return true; -+} -+ -+void fp_FieldRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+ // UT_ASSERT(!isDirty()); -+ -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+ UT_sint32 xoff = 0, yoff = 0; -+ -+ // need to clear full height of line, in case we had a selection -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ UT_sint32 iLineHeight = getLine()->getHeight(); -+ Fill(getGraphics(), xoff, yoff, getWidth(), iLineHeight); -+} -+ -+void fp_FieldRun::_defaultDraw(dg_DrawArgs* pDA) -+{ -+ GR_Graphics * pG = pDA->pG; -+ -+ // TODO is this really needed -+ // should not be, since lookupProperties is called on -+ // formatting changes - Tomas -+ // lookupProperties(); -+ UT_sint32 xoff = 0, yoff = 0; -+ -+ GR_Painter painter(pG); -+ -+ // need screen locations of this run -+ -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ -+ UT_sint32 iYdraw = pDA->yoff - getAscent()-1; -+ -+ if (m_fPosition == TEXT_POSITION_SUPERSCRIPT) -+ { -+ iYdraw -= getAscent() * 1/2; -+ } -+ else if (m_fPosition == TEXT_POSITION_SUBSCRIPT) -+ { -+ iYdraw += getDescent(); // * 3/2 -+ } -+ -+ //if (pG->queryProperties(GR_Graphics::DGP_SCREEN)) -+ { -+ UT_uint32 iRunBase = getBlock()->getPosition() + getBlockOffset(); -+ -+// -+// Sevior was here -+// UT_sint32 iFillTop = iYdraw; -+ UT_sint32 iFillTop = iYdraw+1; -+ UT_sint32 iFillHeight = getAscent() + getDescent(); -+ -+ FV_View* pView = _getView(); -+ UT_uint32 iSelAnchor = pView->getSelectionAnchor(); -+ UT_uint32 iPoint = pView->getPoint(); -+ -+ UT_uint32 iSel1 = UT_MIN(iSelAnchor, iPoint); -+ UT_uint32 iSel2 = UT_MAX(iSelAnchor, iPoint); -+ -+ UT_ASSERT(iSel1 <= iSel2); -+ bool bIsInTOC = getBlock()->isContainedByTOC(); -+ if ( -+ isInSelectedTOC() || (!bIsInTOC && ( -+ /* pView->getFocus()!=AV_FOCUS_NONE && */ -+ (iSel1 <= iRunBase) -+ && (iSel2 > iRunBase))) -+ ) -+ { -+ UT_RGBColor color(_getView()->getColorSelBackground()); -+ pG->setColor(_getView()->getColorSelForeground()); -+ painter.fillRect(color, pDA->xoff, iFillTop, getWidth(), iFillHeight); -+ -+ } -+ else -+ { -+ Fill(getGraphics(),pDA->xoff, iFillTop, getWidth(), iFillHeight); -+ pG->setColor(_getColorFG()); -+ } -+ } -+ -+ pG->setFont(_getFont()); -+ -+ -+ UT_uint32 len = UT_UCS4_strlen(m_sFieldValue); -+ UT_return_if_fail(len); -+ -+ painter.drawChars(m_sFieldValue, 0, len, pDA->xoff,iYdraw, NULL); -+// -+// Draw underline/overline/strikethough -+// -+ UT_sint32 yTopOfRun = pDA->yoff - getAscent()-1; // Hack to remove -+ //character dirt -+ UT_DEBUGMSG(("xoff infield before drawdecors %d \n",pDA->xoff)); -+ drawDecors( pDA->xoff, yTopOfRun,pG); -+ -+} -+ -+// BEGIN DOM work on some new fields -+ -+fp_FieldCharCountRun::fp_FieldCharCountRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldCharCountRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue; -+ -+ FV_View *pView = _getView(); -+ if(!pView) -+ { -+ szFieldValue ="?"; -+ } -+ else -+ { -+ FV_DocCount cnt = pView->countWords(); -+ UT_UTF8String_sprintf(szFieldValue, "%d", cnt.ch_sp); -+ } -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue.utf8_str())); -+ -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldNonBlankCharCountRun::fp_FieldNonBlankCharCountRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldNonBlankCharCountRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue ("?"); -+ -+ FV_View *pView = _getView(); -+ if(pView) -+ { -+ FV_DocCount cnt = pView->countWords(); -+ UT_UTF8String_sprintf(szFieldValue, "%d", cnt.ch_no); -+ } -+ -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue.utf8_str())); -+ -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldLineCountRun::fp_FieldLineCountRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldLineCountRun::calculateValue(void) -+{ -+ FV_View *pView = _getView(); -+ UT_UTF8String szFieldValue ("?"); -+ -+ if(pView) -+ { -+ FV_DocCount cnt = pView->countWords(); -+ UT_UTF8String_sprintf(szFieldValue, "%d", cnt.line); -+ } -+ -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue.utf8_str())); -+ -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldParaCountRun::fp_FieldParaCountRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+ -+bool fp_FieldParaCountRun::calculateValue(void) -+{ -+ FV_View *pView = _getView(); -+ UT_UTF8String szFieldValue ("?"); -+ if(pView) -+ { -+ FV_DocCount cnt = pView->countWords(); -+ UT_UTF8String_sprintf(szFieldValue, "%d", cnt.para); -+ } -+ -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue.utf8_str())); -+ -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldWordCountRun::fp_FieldWordCountRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldWordCountRun::calculateValue(void) -+{ -+ FV_View *pView = _getView(); -+ UT_UTF8String szFieldValue ("?"); -+ if(pView) -+ { -+ FV_DocCount cnt = pView->countWords(); -+ UT_UTF8String_sprintf(szFieldValue, "%d", cnt.word); -+ } -+ -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue.utf8_str())); -+ -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+// mm/dd/yy notation -+fp_FieldMMDDYYRun::fp_FieldMMDDYYRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldMMDDYYRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%m/%d/%y", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+// dd/mm/yy time -+fp_FieldDDMMYYRun::fp_FieldDDMMYYRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldDDMMYYRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%d/%m/%y", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+// Month Day, Year -+fp_FieldMonthDayYearRun::fp_FieldMonthDayYearRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldMonthDayYearRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%B %d, %Y", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldMthDayYearRun::fp_FieldMthDayYearRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldMthDayYearRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%b %d, %Y", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldDefaultDateRun::fp_FieldDefaultDateRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldDefaultDateRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%c", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldDefaultDateNoTimeRun::fp_FieldDefaultDateNoTimeRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldDefaultDateNoTimeRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%x", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldWkdayRun::fp_FieldWkdayRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldWkdayRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%A", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(g_strdup(szFieldValue))); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldDOYRun::fp_FieldDOYRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldDOYRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%j", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldMilTimeRun::fp_FieldMilTimeRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldMilTimeRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%H:%M:%S", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldAMPMRun::fp_FieldAMPMRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldAMPMRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%p", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldTimeEpochRun::fp_FieldTimeEpochRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldTimeEpochRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue; -+ -+ time_t tim = time(NULL); -+ UT_UTF8String_sprintf(szFieldValue, "%ld", static_cast(tim)); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue.utf8_str())); -+ -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldDateTimeCustomRun::fp_FieldDateTimeCustomRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldDateTimeCustomRun::calculateValue(void) -+{ -+ fd_Field * fld = getField(); -+ if (fld) { -+ const gchar * param = fld->getParameter (); -+ -+ if (!param) // sensible fallback if no param specified -+ param = "%x %X"; -+ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, param, pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+ } -+ -+ return false; -+} -+ -+fp_FieldTimeZoneRun::fp_FieldTimeZoneRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldTimeZoneRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%Z", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldBuildIdRun::fp_FieldBuildIdRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldBuildIdRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue(XAP_App::s_szBuild_ID); -+ if (getField()) -+ getField()->setValue(static_cast(XAP_App::s_szBuild_ID)); -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldBuildVersionRun::fp_FieldBuildVersionRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldBuildVersionRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue(XAP_App::s_szBuild_Version); -+ if (getField()) -+ getField()->setValue(static_cast(XAP_App::s_szBuild_Version)); -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldBuildOptionsRun::fp_FieldBuildOptionsRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldBuildOptionsRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue(XAP_App::s_szBuild_Options); -+ if (getField()) -+ getField()->setValue(static_cast(XAP_App::s_szBuild_Options)); -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldBuildTargetRun::fp_FieldBuildTargetRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldBuildTargetRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue(XAP_App::s_szBuild_Target); -+ if (getField()) -+ getField()->setValue(static_cast(XAP_App::s_szBuild_Target)); -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldBuildCompileDateRun::fp_FieldBuildCompileDateRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldBuildCompileDateRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue(XAP_App::s_szBuild_CompileDate); -+ if (getField()) -+ getField()->setValue(static_cast(XAP_App::s_szBuild_CompileDate)); -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldBuildCompileTimeRun::fp_FieldBuildCompileTimeRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldBuildCompileTimeRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue(XAP_App::s_szBuild_CompileTime); -+ if (getField()) -+ getField()->setValue(static_cast(XAP_App::s_szBuild_CompileTime)); -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+ -+// Refers to an footnote in the main body of the text. -+fp_FieldFootnoteRefRun::fp_FieldFootnoteRefRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+ const PP_AttrProp * pp = getSpanAP(); -+ const gchar * footid; -+ bool bRes = pp->getAttribute("footnote-id", footid); -+ -+ UT_ASSERT(bRes); -+ m_iPID = atol(footid); -+ -+ // see bug 9793 -+ _setDirection(pBL->getDominantDirection()); -+} -+ -+ -+bool fp_FieldFootnoteRefRun::calculateValue(void) -+{ -+ const PP_AttrProp * pp = getSpanAP(); -+ if(pp == NULL) -+ { -+ return false; -+ } -+ const gchar * footid = NULL; -+ bool bRes = pp->getAttribute("footnote-id", footid); -+ -+ UT_ASSERT(bRes); -+ if(!bRes) -+ { -+ return false; -+ } -+ FV_View * pView = _getView(); -+ UT_uint32 iPID = atoi(footid); -+ UT_sint32 footnoteNo = pView->getLayout()->getFootnoteVal(iPID); -+ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ UT_String sFieldValue; -+ FootnoteType iFootType = pView->getLayout()->getFootnoteType(); -+ pView->getLayout()->getStringFromFootnoteVal(sFieldValue,footnoteNo,iFootType); -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, sFieldValue.c_str()); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+bool fp_FieldFootnoteRefRun::canBreakBefore(void) const -+{ -+ return false; -+} -+ -+fp_FieldFootnoteAnchorRun::fp_FieldFootnoteAnchorRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+ const PP_AttrProp * pp = getSpanAP(); -+ const gchar * footid; -+ bool bRes = pp->getAttribute("footnote-id", footid); -+ -+ UT_ASSERT(bRes); -+ m_iPID = atol(footid); -+ -+ // see bug 9793 -+ _setDirection(pBL->getDominantDirection()); -+} -+ -+// Appears in the FootnoteContainer, one per footnote. -+bool fp_FieldFootnoteAnchorRun::calculateValue(void) -+{ -+ const PP_AttrProp * pp = getSpanAP(); -+ const gchar * footid = NULL; -+ bool bRes = pp->getAttribute("footnote-id", footid); -+ -+ UT_ASSERT(bRes); -+ if(footid == NULL) -+ { -+ return false; -+ } -+ UT_uint32 iPID = atoi(footid); -+ FV_View * pView = _getView(); -+ UT_sint32 footnoteNo = pView->getLayout()->getFootnoteVal(iPID); -+ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ FootnoteType iFootType = pView->getLayout()->getFootnoteType(); -+ -+ UT_String sFieldValue; -+ pView->getLayout()->getStringFromFootnoteVal(sFieldValue,footnoteNo,iFootType); -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, sFieldValue.c_str()); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+ -+fp_FieldEndnoteAnchorRun::fp_FieldEndnoteAnchorRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+ const PP_AttrProp * pp = getSpanAP(); -+ const gchar * footid; -+ bool bRes = pp->getAttribute("endnote-id", footid); -+ -+ UT_ASSERT(bRes); -+ m_iPID = atoi(footid); -+ -+ // see bug 9793 -+ _setDirection(pBL->getDominantDirection()); -+} -+ -+// Appears in the EndnoteSection, one per endnote. -+bool fp_FieldEndnoteAnchorRun::calculateValue(void) -+{ -+ -+ const PP_AttrProp * pp = getSpanAP(); -+ const gchar * footid = NULL; -+ bool bRes = pp->getAttribute("endnote-id", footid); -+ -+ UT_ASSERT(bRes); -+ if(footid == NULL) -+ { -+ return false; -+ } -+ UT_uint32 iPID = atoi(footid); -+ FV_View * pView = _getView(); -+ UT_sint32 endnoteNo = pView->getLayout()->getEndnoteVal(iPID); -+ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ FootnoteType iEndType = pView->getLayout()->getEndnoteType(); -+ -+ UT_String sFieldValue; -+ pView->getLayout()->getStringFromFootnoteVal(sFieldValue,endnoteNo,iEndType); -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, sFieldValue.c_str()); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+ -+fp_FieldEndnoteRefRun::fp_FieldEndnoteRefRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+ const PP_AttrProp * pp = getSpanAP(); -+ const gchar * footid; -+ bool bRes = pp->getAttribute("endnote-id", footid); -+ -+ UT_ASSERT(bRes); -+ m_iPID = atoi(footid); -+ -+ // see bug 9793 -+ _setDirection(pBL->getDominantDirection()); -+} -+ -+// Appears in the EndnoteSection, one per endnote. -+bool fp_FieldEndnoteRefRun::calculateValue(void) -+{ -+ -+ const PP_AttrProp * pp = getSpanAP(); -+ const gchar * footid = NULL; -+ bool bRes = pp->getAttribute("endnote-id", footid); -+ -+ UT_ASSERT(bRes); -+ if(footid == NULL) -+ { -+ return false; -+ } -+ UT_uint32 iPID = atoi(footid); -+ FV_View * pView = _getView(); -+ UT_sint32 endnoteNo = pView->getLayout()->getEndnoteVal(iPID); -+ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ FootnoteType iEndType = pView->getLayout()->getEndnoteType(); -+ -+ UT_String sFieldValue; -+ pView->getLayout()->getStringFromFootnoteVal(sFieldValue,endnoteNo,iEndType); -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, sFieldValue.c_str()); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+bool fp_FieldEndnoteRefRun::canBreakBefore(void) const -+{ -+ return false; -+} -+ -+fp_FieldTimeRun::fp_FieldTimeRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldTimeRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%X", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldDateRun::fp_FieldDateRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldDateRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ time_t tim = time(NULL); -+ struct tm *pTime = localtime(&tim); -+ -+ strftime(szFieldValue, FPFIELD_MAX_LENGTH, "%A %B %d, %Y", pTime); -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldFileNameRun::fp_FieldFileNameRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldFileNameRun::calculateValue(void) -+{ -+ UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1]; -+ sz_ucs_FieldValue[0] = 0; -+ -+ char szFieldValue[FPFIELD_MAX_LENGTH + 1]; -+ -+ PD_Document * pDoc = getBlock()->getDocument(); -+ UT_ASSERT(pDoc); -+ -+ //copy in the name or some wierd char instead -+ const char * name = pDoc->getFilename(); -+ if (!name) -+ name = "*"; -+ -+ strcpy (szFieldValue, name); -+ -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue)); -+ -+ UT_UCS4_strcpy_char(sz_ucs_FieldValue, szFieldValue); -+ -+ return _setValue(sz_ucs_FieldValue); -+} -+ -+fp_FieldPageNumberRun::fp_FieldPageNumberRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldPageNumberRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue ("?"); -+ -+ if (getLine() && getLine()->getContainer() && getLine()->getContainer()->getPage()) -+ { -+ fp_Page* pPage = getLine()->getContainer()->getPage(); -+ FL_DocLayout* pDL = pPage->getDocLayout(); -+ fl_DocSectionLayout * pDSL = static_cast(pPage->getOwningSection()); -+ UT_sint32 iPageNum = 0; -+ UT_uint32 iNumPages = pDL->countPages(); -+ for (UT_uint32 i=0; igetNthPage(i); -+ -+ if (pPg == pPage) -+ { -+ iPageNum = i + 1; -+ break; -+ } -+ } -+ while(pDSL && !pDSL->arePageNumbersRestarted()) -+ { -+ pDSL = pDSL->getPrevDocSection(); -+ } -+ UT_sint32 icnt = 0; -+ fp_Page * pFirstPage = NULL; -+ if(pDSL && pDSL->arePageNumbersRestarted()) -+ { -+ fp_Container * pCon = pDSL->getFirstContainer(); -+ if(pCon) -+ { -+ bool bFound = false; -+ pFirstPage = pCon->getPage(); -+ while(pFirstPage && !bFound) -+ { -+ if(pDSL == static_cast(pFirstPage->getOwningSection())) -+ { -+ bFound = true; -+ break; -+ } -+ pFirstPage = pFirstPage->getNext(); -+ } -+ if(bFound) -+ { -+ while(pFirstPage && (pFirstPage != pPage)) -+ { -+ icnt++; -+ pFirstPage = pFirstPage->getNext(); -+ } -+ UT_ASSERT(pFirstPage); -+ iPageNum = pDSL->getRestartedPageNumber() + icnt; -+ } -+ } -+ } -+#if 0 -+ // FIXME:jskov Cannot assert here since the field might get -+ // updated while the page is still being populated (and thus not in -+ // the doc's page list). Surely the field should not get updated -+ // until the page is fully populated? -+ UT_ASSERT(iPageNum > 0); -+#endif -+ -+ UT_UTF8String_sprintf(szFieldValue, "%d", iPageNum); -+ } -+ -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue.utf8_str())); -+ -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+//////////////////////////////////////////////////////////////////////////// -+/////////////////////////////////////////////////////////////////////////// -+ -+fp_FieldPageReferenceRun::fp_FieldPageReferenceRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) -+ : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldPageReferenceRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue ("?"); -+ -+ if(!_getParameter()) -+ return false; -+ -+ FV_View * pView = _getView(); -+ // on import the field value can be requested before the View exists -+ // so we cannot assert here -+ //UT_ASSERT(pView); -+ if(!pView) -+ return false; -+ -+ fp_Run* pRun = NULL; -+ fl_BlockLayout * pBlock; -+ fl_SectionLayout * pSection = pView->getLayout()->getFirstSection(); -+ UT_ASSERT(pSection); -+ bool bFound = false; -+ -+ while (pSection) -+ { -+ pBlock = static_cast(pSection->getFirstLayout()); -+ -+ while (pBlock) -+ { -+ pRun = pBlock->getFirstRun(); -+ while (pRun) -+ { -+ xxx_UT_DEBUGMSG(("pRun 0x%x, type %d\n", pRun, pRun->getType())); -+ if(pRun->getType() == FPRUN_BOOKMARK) -+ { -+ fp_BookmarkRun * pB = static_cast(pRun); -+ if(pB->isStartOfBookmark() && !strcmp(_getParameter(),pB->getName())) -+ { -+ bFound = true; -+ break; -+ } -+ } -+ pRun = pRun->getNextRun(); -+ } -+ if(bFound) -+ break; -+ -+ pBlock = static_cast(pBlock->getNext()); -+ } -+ if(bFound) -+ break; -+ pSection = static_cast(pSection->getNext()); -+ } -+ -+ if( pRun -+ && pRun->getLine() -+ && pRun->getLine()->getContainer() -+ && pRun->getLine()->getContainer()->getPage()) -+ { -+ fp_Page* pPage = pRun->getLine()->getContainer()->getPage(); -+ FL_DocLayout* pDL = pPage->getDocLayout(); -+ -+ UT_sint32 iPageNum = 0; -+ UT_uint32 iNumPages = pDL->countPages(); -+ for (UT_uint32 i=0; igetNthPage(i); -+ -+ if (pPg == pPage) -+ { -+ iPageNum = i + 1; -+ break; -+ } -+ } -+ UT_UTF8String_sprintf(szFieldValue, "%d", iPageNum); -+ } -+ else -+ { -+ const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); -+ UT_String Msg1; -+ pSS->getValue(AP_STRING_ID_FIELD_Error, XAP_App::getApp()->getDefaultEncoding(), Msg1); -+ -+ UT_String Msg2; -+ pSS->getValue(AP_STRING_ID_MSG_BookmarkNotFound, XAP_App::getApp()->getDefaultEncoding(), Msg2); -+ UT_String format; -+ -+ UT_String_sprintf(format, "{%s: %s}", Msg1.c_str(), Msg2.c_str()); -+ UT_UTF8String_sprintf(szFieldValue, format.c_str(), _getParameter()); -+ } -+ -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue.utf8_str())); -+ -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+ -+/////////////////////////////////////////////////////////////////////////// -+ -+fp_FieldPageCountRun::fp_FieldPageCountRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldPageCountRun::calculateValue(void) -+{ -+ UT_UTF8String szFieldValue ("?"); -+ -+ if (getLine() && getLine()->getContainer() && getLine()->getContainer()->getPage()) -+ { -+ -+ fp_Page* pPage = getLine()->getContainer()->getPage(); -+ FL_DocLayout* pDL = pPage->getDocLayout(); -+ -+ UT_UTF8String_sprintf(szFieldValue, "%d", pDL->countPages()); -+ } -+ -+ if (getField()) -+ getField()->setValue(static_cast(szFieldValue.utf8_str())); -+ -+ return _setValue(szFieldValue.ucs4_str().ucs4_str()); -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+fp_FieldMailMergeRun::fp_FieldMailMergeRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) -+ : fp_FieldRun(pBL, iOffsetFirst, iLen) -+{ -+} -+ -+bool fp_FieldMailMergeRun::calculateValue(void) -+{ -+ fd_Field * fld = getField(); -+ if (fld) { -+ const gchar * param = fld->getParameter (); -+ -+ if (!param) -+ return false; -+ -+ UT_UTF8String value ; -+ -+ PD_Document * pDoc = getBlock()->getDocument(); -+ UT_ASSERT(pDoc); -+ -+ if (!pDoc->mailMergeFieldExists(param)) -+ { -+ // we'll take this branch if there's no mapping, we'll display -+ // the field name instead -+ value = "<"; -+ value += param; -+ value += ">"; -+ } -+ else -+ { -+ value = pDoc->getMailMergeField(param); -+ } -+ -+ fld->setValue(static_cast(value.utf8_str())); -+ -+ return _setValue(value.ucs4_str().ucs4_str()); -+ } -+ -+ return false; -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+fp_FieldMetaRun::fp_FieldMetaRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen, const char * which) -+ : fp_FieldRun(pBL, iOffsetFirst, iLen), m_which(which) -+{ -+} -+ -+bool fp_FieldMetaRun::calculateValue(void) -+{ -+ PD_Document * pDoc = getBlock()->getDocument(); -+ UT_ASSERT(pDoc); -+ -+ UT_UTF8String value ; -+ if (!pDoc->getMetaDataProp(m_which, value) || !value.size()) -+ value = " "; -+ -+ if (getField()) -+ getField()->setValue(static_cast(value.utf8_str())); -+ -+ return _setValue(value.ucs4_str().ucs4_str()); -+} -+ -+fp_FieldMetaTitleRun::fp_FieldMetaTitleRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_TITLE) -+{ -+} -+ -+fp_FieldMetaCreatorRun::fp_FieldMetaCreatorRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_CREATOR) -+{ -+} -+ -+fp_FieldMetaSubjectRun::fp_FieldMetaSubjectRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_SUBJECT) -+{ -+} -+ -+fp_FieldMetaPublisherRun::fp_FieldMetaPublisherRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_PUBLISHER) -+{ -+} -+ -+fp_FieldMetaDateRun::fp_FieldMetaDateRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_DATE) -+{ -+} -+ -+fp_FieldMetaTypeRun::fp_FieldMetaTypeRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_TYPE) -+{ -+} -+ -+fp_FieldMetaLanguageRun::fp_FieldMetaLanguageRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_LANGUAGE) -+{ -+} -+ -+fp_FieldMetaRightsRun::fp_FieldMetaRightsRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_RIGHTS) -+{ -+} -+ -+fp_FieldMetaKeywordsRun::fp_FieldMetaKeywordsRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_KEYWORDS) -+{ -+} -+ -+fp_FieldMetaContributorRun::fp_FieldMetaContributorRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_CONTRIBUTOR) -+{ -+} -+ -+fp_FieldMetaCoverageRun::fp_FieldMetaCoverageRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_COVERAGE) -+{ -+} -+ -+fp_FieldMetaDescriptionRun::fp_FieldMetaDescriptionRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_FieldMetaRun(pBL, iOffsetFirst, iLen, PD_META_KEY_DESCRIPTION) -+{ -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+fp_ForcedColumnBreakRun::fp_ForcedColumnBreakRun(fl_BlockLayout* pBL,UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_Run(pBL, iOffsetFirst, iLen, FPRUN_FORCEDCOLUMNBREAK) -+{ -+ lookupProperties(); -+} -+ -+void fp_ForcedColumnBreakRun::_lookupProperties(const PP_AttrProp * /*pSpanAP*/, -+ const PP_AttrProp * /*pBlockAP*/, -+ const PP_AttrProp * /*pSectionAP*/, -+ GR_Graphics *) -+{ -+ fd_Field * fd = NULL; -+ -+ getBlock()->getField(getBlockOffset(),fd); -+ _setField(fd); -+ -+ _inheritProperties(); -+ _setWidth(1); -+} -+ -+bool fp_ForcedColumnBreakRun::canBreakAfter(void) const -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ -+ return false; -+} -+ -+bool fp_ForcedColumnBreakRun::canBreakBefore(void) const -+{ -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ -+ return false; -+} -+ -+bool fp_ForcedColumnBreakRun::_letPointPass(void) const -+{ -+ return false; -+} -+ -+void fp_ForcedColumnBreakRun::mapXYToPosition(UT_sint32 /* x */, UT_sint32 /*y*/, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ pos = getBlock()->getPosition() + getBlockOffset(); -+ bBOL = false; -+ bEOL = false; -+} -+ -+void fp_ForcedColumnBreakRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ //UT_DEBUGMSG(("fintPointCoords: ForcedColumnBreakRun\n")); -+ UT_ASSERT(getBlockOffset() == iOffset || getBlockOffset()+1 == iOffset); -+ -+ UT_sint32 xoff, yoff; -+ -+ fp_Run* pPropRun = _findPrevPropertyRun(); -+ -+ if (pPropRun) -+ { -+ if(FPRUN_TEXT == pPropRun->getType()) -+ { -+ pPropRun->findPointCoords(iOffset, x, y, x2, y2, height, bDirection); -+ } -+ else -+ { -+ height = getHeight(); -+ getLine()->getOffsets(this, xoff, yoff); -+ x = xoff; -+ y = yoff; -+ } -+ } -+ else -+ { -+ height = getHeight(); -+ getLine()->getOffsets(this, xoff, yoff); -+ x = xoff; -+ y = yoff; -+ } -+ -+ x2 = x; -+ y2 = y; -+} -+ -+void fp_ForcedColumnBreakRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+ // UT_ASSERT(!isDirty()); -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+ -+ UT_sint32 xoff = 0, yoff = 0; -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ UT_sint32 iWidth = getLine()->getMaxWidth() - getLine()->calculateWidthOfLine(); -+ Fill(getGraphics(),xoff,yoff,iWidth,getLine()->getHeight()); -+} -+ -+void fp_ForcedColumnBreakRun::_draw(dg_DrawArgs* pDA) -+{ -+ GR_Graphics * pG = pDA->pG; -+ if (!(pG->queryProperties(GR_Graphics::DGP_SCREEN))){ -+ return; -+ } -+ -+ FV_View* pView = _getView(); -+ UT_ASSERT(pView); -+ if(!pView->getShowPara()){ -+ return; -+ } -+ -+ UT_sint32 iLineWidth = getLine()->getMaxWidth(); -+ -+ UT_UCSChar *pColumnBreak; -+ UT_UCS4_cloneString_char(&pColumnBreak,"Column Break"); -+ _drawTextLine(pDA->xoff,pDA->yoff+getLine()->getAscent(),iLineWidth,getLine()->getHeight(),pColumnBreak); -+ FREEP(pColumnBreak); -+} -+ -+////////////////////////////////////////////////////////////////// -+////////////////////////////////////////////////////////////////// -+ -+fp_ForcedPageBreakRun::fp_ForcedPageBreakRun(fl_BlockLayout* pBL, UT_uint32 iOffsetFirst, UT_uint32 iLen) : fp_Run(pBL, iOffsetFirst, iLen, FPRUN_FORCEDPAGEBREAK) -+{ -+ lookupProperties(); -+} -+ -+void fp_ForcedPageBreakRun::_lookupProperties(const PP_AttrProp * /*pSpanAP*/, -+ const PP_AttrProp * /*pBlockAP*/, -+ const PP_AttrProp * /*pSectionAP*/, -+ GR_Graphics *) -+{ -+ fd_Field * fd = NULL; -+ -+ getBlock()->getField(getBlockOffset(),fd); -+ _setField(fd); -+ -+ _inheritProperties(); -+ _setWidth(1); -+} -+ -+bool fp_ForcedPageBreakRun::canBreakAfter(void) const -+{ -+ return false; -+} -+ -+bool fp_ForcedPageBreakRun::canBreakBefore(void) const -+{ -+ return false; -+} -+ -+bool fp_ForcedPageBreakRun::_letPointPass(void) const -+{ -+ return false; -+} -+ -+void fp_ForcedPageBreakRun::mapXYToPosition(UT_sint32 /* x */, UT_sint32 /*y*/, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool &isTOC) -+{ -+ pos = getBlock()->getPosition() + getBlockOffset(); -+ bBOL = false; -+ bEOL = false; -+} -+ -+void fp_ForcedPageBreakRun::findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& x2, UT_sint32& y2, UT_sint32& height, bool& bDirection) -+{ -+ //UT_DEBUGMSG(("fintPointCoords: ForcedPageBreakRun\n")); -+ UT_ASSERT(getBlockOffset() == iOffset || getBlockOffset()+1 == iOffset); -+ -+ UT_sint32 xoff, yoff; -+ -+ fp_Run* pPropRun = _findPrevPropertyRun(); -+ -+ if (pPropRun) -+ { -+ height = pPropRun->getHeight(); -+ if(FPRUN_TEXT == pPropRun->getType()) -+ { -+ pPropRun->findPointCoords(iOffset, x, y, x2, y2, height, bDirection); -+ } -+ else -+ { -+ height = getHeight(); -+ getLine()->getOffsets(this, xoff, yoff); -+ x = xoff; -+ y = yoff; -+ } -+ } -+ else -+ { -+ height = getHeight(); -+ getLine()->getOffsets(this, xoff, yoff); -+ x = xoff; -+ y = yoff; -+ } -+ -+ if (iOffset == getBlockOffset()+1) -+ { -+ FV_View* pView = _getView(); -+ if (pView->getShowPara()) -+ { -+ x += getWidth(); -+ } -+ } -+ -+ x2 = x; -+ y2 = y; -+} -+ -+void fp_ForcedPageBreakRun::_clearScreen(bool /* bFullLineHeightRect */) -+{ -+ // UT_ASSERT(!isDirty()); -+ UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)); -+ -+ UT_sint32 xoff = 0, yoff = 0; -+ getLine()->getScreenOffsets(this, xoff, yoff); -+ UT_sint32 iWidth = getLine()->getMaxWidth() - getLine()->calculateWidthOfLine(); -+ Fill(getGraphics(),xoff,yoff,iWidth,getLine()->getHeight()); -+} -+ -+void fp_ForcedPageBreakRun::_draw(dg_DrawArgs* pDA) -+{ -+ GR_Graphics * pG = pDA->pG; -+ -+ if (!(pG->queryProperties(GR_Graphics::DGP_SCREEN))){ -+ return; -+ } -+ -+ FV_View* pView = _getView(); -+ UT_ASSERT(pView); -+ if(!pView->getShowPara()){ -+ return; -+ } -+ -+ UT_sint32 iLineWidth = getLine()->getMaxWidth(); -+ -+ UT_UCSChar *pPageBreak; -+ UT_UCS4_cloneString_char(&pPageBreak,"Page Break"); -+ -+ _drawTextLine(pDA->xoff,pDA->yoff+getLine()->getAscent(),iLineWidth,getLine()->getHeight(),pPageBreak); -+ FREEP(pPageBreak); -+} -+ -+// translates logical position in a run into visual position -+// (will also translate correctly visual -> logical) -+UT_uint32 fp_Run::getVisPosition(UT_uint32 iLogPos) -+{ -+ if(getVisDirection() == UT_BIDI_RTL) //rtl needs translation -+ { -+ return (getLength() - iLogPos - 1); -+ } -+ else return (iLogPos); -+} -+ -+//translates a visual position in a span of length iLen to logical pos -+//or vice versa -+UT_uint32 fp_Run::getVisPosition(UT_uint32 iLogPos, UT_uint32 iLen) -+{ -+ if(getVisDirection() == UT_BIDI_RTL) //rtl needs translation -+ { -+ return (iLen - iLogPos - 1); -+ } -+ else return (iLogPos); -+} -+ -+//returns the logical offset of the first visual character -+UT_uint32 fp_Run::getOffsetFirstVis() -+{ -+ if(getVisDirection() == UT_BIDI_RTL) //rtl, requires translation -+ { -+ return(getBlockOffset() + getLength() - 1); -+ } -+ else return (getBlockOffset()); -+} -+ -+//translates visual offset to logical one, can be also used for translation -+//in the other direction -+UT_uint32 fp_Run::getOffsetLog(UT_uint32 iVisOff) -+{ -+ if(getVisDirection() == UT_BIDI_RTL) //rtl needs translation -+ { -+ return(getBlockOffset() + getLength() - iVisOff + getBlockOffset() - 1); -+ } -+ else return (iVisOff); -+} -+ -+fp_Run * fp_Run::getNextVisual() -+{ -+ if(!getLine()) -+ return NULL; -+ -+ UT_uint32 iIndxVis = getLine()->getVisIndx(this); -+ -+ return getLine()->getRunAtVisPos(iIndxVis + 1); -+} -+ -+fp_Run * fp_Run::getPrevVisual() -+{ -+ if(!getLine()) -+ return NULL; -+ -+ UT_uint32 iIndxVis = getLine()->getVisIndx(this); -+ -+ if(!iIndxVis) -+ return NULL; -+ -+ return getLine()->getRunAtVisPos(iIndxVis - 1); -+} -+ -+void fp_Run::setDirection(UT_BidiCharType iDir) -+{ -+ xxx_UT_DEBUGMSG(("fp_Run::SetDirection, getDirection() %d, iDir %d, run type %d\n", getDirection(), iDir, getType())); -+ UT_BidiCharType iDirection = iDir != UT_BIDI_UNSET ? iDir : UT_BIDI_WS; -+ if(getDirection() != iDirection) -+ { -+ UT_BidiCharType origDirection = getDirection(); -+ _setDirection(iDirection); -+ clearScreen(); -+ /* -+ if this run belongs to a line we have to notify the line that -+ that it now contains a run of this direction, if it does not belong -+ to a line this will be taken care of by the fp_Line:: member function -+ used to add the run to the line (generally, we set it here if this -+ is a run that is being typed in and it gets set in the member -+ functions when the run is loaded from a document on the disk.) -+ */ -+ -+ if(getLine()) -+ getLine()->changeDirectionUsed(origDirection,getDirection(),true); -+ } -+} -+ -+// returns the direction with which the run is displayed, -+UT_BidiCharType fp_Run::getVisDirection() -+{ -+#ifndef NO_BIDI_SUPPORT -+ FV_View * pView = _getView(); -+ if(pView && pView->getBidiOrder() != FV_Order_Visual) -+ { -+ if(pView->getBidiOrder() == FV_Order_Logical_LTR) -+ return UT_BIDI_LTR; -+ else -+ return UT_BIDI_RTL; -+ } -+ else if(m_iVisDirection == UT_BIDI_UNSET) -+ { -+ if(m_pLine) -+ { -+ m_pLine->_createMapOfRuns(); -+ UT_ASSERT(m_iVisDirection != UT_BIDI_UNSET); -+ return m_iVisDirection; -+ } -+ else if(getBlock()) -+ return getBlock()->getDominantDirection(); -+ else -+ { -+ bool b; -+ XAP_App::getApp()->getPrefsValueBool(static_cast(AP_PREF_KEY_DefaultDirectionRtl), &b); -+ if(b) -+ return UT_BIDI_RTL; -+ else -+ return UT_BIDI_LTR; -+ } -+ } -+ else -+ return m_iVisDirection; -+#else -+ return UT_BIDI_LTR; -+#endif -+} -+ -+void fp_Run::setVisDirection(UT_BidiCharType iDir) -+{ -+ if( iDir != m_iVisDirection -+ && m_iVisDirection != UT_BIDI_UNSET -+ /*&& m_eRefreshDrawBuffer == GRSR_BufferClean*/) -+ { -+ // the text in the buffer is in the wrong order, schedule it -+ // for refresh -+ m_eRefreshDrawBuffer = GRSR_Unknown; -+ } -+ -+ m_iVisDirection = iDir; -+} -+ -+#if 0 -+void fp_Run::setDirectionProperty(UT_BidiCharType dir) -+{ -+ const gchar * prop[] = {NULL, NULL, 0}; -+ const gchar direction[] = "dir"; -+ const gchar rtl[] = "rtl"; -+ const gchar ltr[] = "ltr"; -+ UT_String other; -+ -+ prop[0] = static_cast(&direction); -+ -+ switch(dir) -+ { -+ case UT_BIDI_LTR: prop[1] = static_cast(<r); break; -+ case UT_BIDI_RTL: prop[1] = static_cast(&rtl); break; -+ default: -+ { -+ // for anything other we will print the UT_BidiCharType value -+ // this will allow us to coallesce runs of same type without -+ // having to list here tons of possible strings -+ // (we could do this for rtl and ltr as well, but "rtl" and "ltr" -+ // are much more informative.) -+ UT_String_sprintf(other,"fbt%d",static_cast(dir)); -+ prop[1] = static_cast(other.c_str()); break; -+ } -+ }; -+ -+ UT_uint32 offset = getBlock()->getPosition() + getBlockOffset(); -+ getBlock()->getDocument()->changeSpanFmt(PTC_AddFmt,offset,offset + getLength(),NULL,prop); -+ UT_DEBUGMSG(("fp_Run::setDirectionProperty: offset=%d, len=%d, dir=\"%s\"\n", offset,getLength(),prop[1])); -+} -+#endif -+ -+/*! -+ The following function allows us to respond to deletion of part of -+ a run in a smart way; this is just default implementation, and -+ there is nothing smart about it, derrived classes should provide -+ their own implementation where it makes sense (see fp_TextRun) -+ -+ \param offset: run offset at which deletion starts -+ \param iLen: length of the deleted section, can reach past the -+ end of the run -+*/ -+void fp_Run::updateOnDelete(UT_uint32 offset, UT_uint32 iLenToDelete) -+{ -+ // do not try to delete past the end of the run ... -+ UT_return_if_fail(offset < m_iLen); -+ -+ UT_uint32 iLen = UT_MIN(iLenToDelete, m_iLen - offset); -+ -+ // do not try to delete nothing ... -+ if(iLen == 0) -+ return; -+ -+ setLength(m_iLen - iLen, true); -+} -+ -+// house keeping -+#undef FPRUN_PROPS_MINI_DUMP -diff -urNad abiword-2.6.2~/abiword/src/text/fmt/xp/fv_View_cmd.cpp abiword-2.6.2/abiword/src/text/fmt/xp/fv_View_cmd.cpp ---- abiword-2.6.2~/abiword/src/text/fmt/xp/fv_View_cmd.cpp 2008-04-17 13:12:32.000000000 +0200 -+++ abiword-2.6.2/abiword/src/text/fmt/xp/fv_View_cmd.cpp 2008-04-17 21:45:40.000000000 +0200 -@@ -4099,10 +4099,10 @@ - while (pRun && pRun->getBlockOffset()+ pRun->getLength() < iRelPos) - pRun= pRun->getNextRun(); - -- UT_ASSERT(pRun); -+ UT_return_if_fail(pRun); - pRun->getPrevRun(); - -- UT_ASSERT(pRun); -+ UT_return_if_fail(pRun); - #if 0 - if(pRun->getType()== FPRUN_FMTMARK || pRun->getType()== FPRUN_HYPERLINK || pRun->getType()== FPRUN_BOOKMARK) - pRun = pRun->getNextRun(); -@@ -4111,9 +4111,7 @@ - #endif - fp_HyperlinkRun * pH = pRun->getHyperlink(); - -- UT_ASSERT(pH); -- if(!pH) -- return; -+ UT_return_if_fail(pH); - - const gchar * pTarget = pH->getTarget(); - -@@ -4140,9 +4138,7 @@ - void FV_View::cmdHyperlinkJump(PT_DocPosition pos) - { - fp_HyperlinkRun * pH = static_cast(getHyperLinkRun(pos)); -- UT_ASSERT(pH); -- if(!pH) -- return; -+ UT_return_if_fail(pH); - - const gchar * pTarget = pH->getTarget(); - -@@ -5857,9 +5853,12 @@ - // locate the squiggle - PT_DocPosition pos = getPoint(); - fl_BlockLayout* pBL = _findBlockAtPosition(pos); -- UT_ASSERT(pBL); -+ UT_return_if_fail(pBL); - fl_PartOfBlock* pPOB = pBL->getSpellSquiggles()->get(pos - pBL->getPosition()); -- UT_ASSERT(pPOB); -+ if(!pPOB) // this can happen with very rapid right-clicks -+ { -+ return; -+ } - - // grab a copy of the word - UT_GrowBuf pgb(1024); -@@ -5896,9 +5895,12 @@ - // locate the squiggle - PT_DocPosition pos = getPoint(); - fl_BlockLayout* pBL = _findBlockAtPosition(pos); -- UT_ASSERT(pBL); -+ UT_return_if_fail(pBL); - fl_PartOfBlock* pPOB = pBL->getSpellSquiggles()->get(pos - pBL->getPosition()); -- UT_ASSERT(pPOB); -+ if(!pPOB) // this can happen with very rapid right-clicks -+ { -+ return; -+ } - - // grab a copy of the word - UT_GrowBuf pgb(1024); -@@ -5991,9 +5993,7 @@ - } - } - pShadow = pHFCon->getShadow(); -- UT_ASSERT(pShadow); -- if(!pShadow) -- return; -+ UT_return_if_fail(pShadow); - - m_pDoc->beginUserAtomicGlob(); - -diff -urNad abiword-2.6.2~/abiword/src/text/fmt/xp/fv_View_cmd.cpp.orig abiword-2.6.2/abiword/src/text/fmt/xp/fv_View_cmd.cpp.orig ---- abiword-2.6.2~/abiword/src/text/fmt/xp/fv_View_cmd.cpp.orig 1970-01-01 01:00:00.000000000 +0100 -+++ abiword-2.6.2/abiword/src/text/fmt/xp/fv_View_cmd.cpp.orig 2008-04-17 21:45:40.000000000 +0200 -@@ -0,0 +1,6313 @@ -+/* AbiWord -+ * Copyright (C) 1998-2000 AbiSource, Inc. -+ * Copyright (c) 2001,2002 Tomas Frydrych -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version 2 -+ * of the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -+ * 02111-1307, USA. -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "ut_assert.h" -+#include "ut_debugmsg.h" -+#include "ut_go_file.h" -+#include "ut_growbuf.h" -+#include "ut_misc.h" -+#include "ut_string.h" -+#include "ut_bytebuf.h" -+#include "ut_timer.h" -+#include "ut_Language.h" -+#include "ut_uuid.h" -+ -+#include "xav_View.h" -+#include "fl_DocLayout.h" -+#include "fl_BlockLayout.h" -+#include "fl_Squiggles.h" -+#include "fl_SectionLayout.h" -+#include "fl_AutoNum.h" -+#include "fp_Page.h" -+#include "fp_PageSize.h" -+#include "fp_Column.h" -+#include "fp_Line.h" -+#include "fp_Run.h" -+#include "fp_TextRun.h" -+#include "fg_Graphic.h" -+#include "fg_GraphicRaster.h" -+#include "pd_Document.h" -+#include "pd_Style.h" -+#include "pp_Property.h" -+#include "pp_AttrProp.h" -+#include "gr_Graphics.h" -+#include "gr_DrawArgs.h" -+#include "ie_types.h" -+#include "xap_App.h" -+#include "xap_Frame.h" -+#include "xap_Clipboard.h" -+#include "ap_TopRuler.h" -+#include "ap_LeftRuler.h" -+#include "ap_Prefs.h" -+#include "ap_Strings.h" -+#include "fd_Field.h" -+#include "pf_Frag_Strux.h" -+ -+#ifdef ENABLE_SPELL -+#include "spell_manager.h" -+#if 1 -+// todo: work around to remove the INPUTWORDLEN restriction for pspell -+#include "ispell_def.h" -+#endif -+#endif -+ -+#include "ut_rand.h" -+#include "fp_TableContainer.h" -+#include "fl_FootnoteLayout.h" -+#include "fl_ContainerLayout.h" -+#include "fl_TOCLayout.h" -+#include "pp_Revision.h" -+ -+#include "ap_Dialog_SplitCells.h" -+#include "ev_Mouse.h" -+#include "fv_View.h" -+ -+// NB -- irrespective of this size, the piecetable will store -+// at max BOOKMARK_NAME_LIMIT of chars as defined in pf_Frag_Bookmark.h -+#define BOOKMARK_NAME_SIZE 30 -+#define CHECK_WINDOW_SIZE if(getWindowHeight() < 20) return; -+ -+/****************************************************************/ -+ -+void FV_View::cmdUnselectSelection(void) -+{ -+ _clearSelection(); -+} -+ -+ -+/*! -+ Move point a number of character positions -+ \param bForward True if moving forward -+ \param count Number of char positions to move -+ -+ \note Cursor movement while there's a selection has the effect of -+ clearing the selection. And only that. See bug 993. -+*/ -+void FV_View::cmdCharMotion(bool bForward, UT_uint32 count) -+{ -+ if (!isSelectionEmpty()) -+ { -+ _moveToSelectionEnd(bForward); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return; -+ } -+ -+ PT_DocPosition iPoint = getPoint(); -+ if (!_charMotion(bForward, count)) -+ { -+ if(bForward) -+ { -+// -+// Reached end of document. -+// -+ UT_DEBUGMSG(("SEVIOR: Reached end of document \n")); -+ m_bPointEOL = true; -+ } -+ else -+ { -+ if(m_bInsertAtTablePending) -+ { -+ m_iInsPoint = iPoint; -+ } -+ else -+ { -+ _setPoint(iPoint); -+ } -+ } -+ -+ bool bOK = true; -+ while(bOK && !isPointLegal() && (getPoint() > 2)) -+ { -+ bOK = _charMotion(false,1); -+ } -+ } -+ else -+ { -+ PT_DocPosition iPoint1 = getPoint(); -+ if ( iPoint1 == iPoint ) -+ { -+ if(!_charMotion(bForward, count)) -+ { -+ _setPoint(iPoint); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return; -+ } -+ if(!isPointLegal()) -+ { -+ _setPoint(iPoint); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return; -+ } -+ } -+ } -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+} -+ -+ -+/*! -+ * Split the merged cells located at the current point in the way specified -+ * by iSplitType -+ */ -+bool FV_View::cmdSplitCells(AP_CellSplitType iSplitType) -+{ -+ PL_StruxDocHandle cellSDH,tableSDH,curSDH,endTableSDH; -+ PL_StruxDocHandle prevCellSDH1,prevCellSDH2; -+ PT_DocPosition posTable,posCell,posFirstInsert,posEndTable; -+ posFirstInsert = 0; -+ UT_sint32 iLeft,iRight,iTop,iBot; -+ UT_sint32 jLeft,jRight,jTop,jBot; -+ PT_DocPosition posCol = getPoint(); -+ if(!isInTable(posCol)) -+ { -+ return false; -+ } -+ getCellParams(posCol, &iLeft, &iRight,&iTop,&iBot); -+ UT_String sCellProps; -+ getCellFormat(posCol,sCellProps); -+// -+// Find the Row and column of the cell at the current point. The strategy -+// will be insert a new cell with the same (row/col depending on the split) -+// and to adjust the rest of the table past this point. -+// -+ UT_sint32 rowSpan = iBot - iTop; -+ UT_sint32 colSpan = iRight - iLeft; -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(posCol,PTX_SectionCell,&cellSDH); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posCol,PTX_SectionTable,&tableSDH); -+ UT_return_val_if_fail(bRes, false); -+ -+ posTable = m_pDoc->getStruxPosition(tableSDH) + 1; -+ posCell = m_pDoc->getStruxPosition(cellSDH); -+ endTableSDH = m_pDoc->getEndTableStruxFromTableSDH(tableSDH); -+ posEndTable = m_pDoc->getStruxPosition(endTableSDH); -+// -+// Got all we need, now set things up to do the insert nicely -+// -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ if (!isSelectionEmpty()) -+ { -+ _clearSelection(); -+ } -+ m_pDoc->setDontImmediatelyLayout(true); -+// -+// Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+// with a bogus line-type property. We'll restore it later. -+// -+ const char * pszTable[3] = {NULL,NULL,NULL}; -+ pszTable[0] = "list-tag"; -+ const char * szListTag = NULL; -+ UT_String sListTag; -+ UT_sint32 iListTag; -+ m_pDoc->getPropertyFromSDH(tableSDH,isShowRevisions(),getRevisionLevel(),pszTable[0],&szListTag); -+ if(szListTag == NULL || *szListTag == '\0') -+ { -+ iListTag = 0; -+ } -+ else -+ { -+ iListTag = atoi(szListTag); -+ iListTag -= 1; -+ } -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+ UT_sint32 splitLeft,splitRight,splitTop,splitBot; -+ UT_sint32 newLeft,newRight,newTop,newBot; -+ UT_sint32 numRows = 0; -+ UT_sint32 numCols = 0; -+ bool bDoSplitSolidHori = false; -+ bool bDoSplitSolidVert = false; -+// -+// OK now insert the cell and do the update -+// -+ m_pDoc-> getRowsColsFromTableSDH(tableSDH, isShowRevisions(), getRevisionLevel(), &numRows, &numCols); -+ -+ if(iSplitType <= hori_right) -+ { -+// -+// This is similar to "insert column" -+// -+ if(iSplitType == hori_left) -+ { -+ splitLeft = iLeft; -+ splitRight = iLeft+1; -+ } -+ else if(iSplitType == hori_mid) -+ { -+ splitLeft = iLeft; -+ if(colSpan == 1) -+ { -+ bDoSplitSolidHori = true; -+ splitRight = iLeft+1; -+ } -+ else -+ { -+ splitRight = iLeft + colSpan/2; -+ } -+ } -+ else if(iSplitType == hori_right) -+ { -+ splitLeft = iLeft; -+ splitRight = iRight -1; -+ } -+ splitTop = iTop; -+ splitBot = iBot; -+ newTop = iTop; -+ newBot = iBot; -+ if(!bDoSplitSolidHori) -+ { -+ newLeft = splitRight; -+ newRight = iRight; -+ } -+ else -+ { -+ newLeft = splitRight; -+ newRight = newLeft+1; -+ } -+ -+ } -+ else -+ { -+ if(iSplitType == vert_above) -+ { -+ newTop = iTop; -+ newBot = iTop +1; -+ } -+ else if(iSplitType == vert_mid) -+ { -+ newTop = iTop; -+ if(rowSpan == 1) -+ { -+ bDoSplitSolidVert = true; -+ newBot = newTop+1; -+ } -+ else -+ { -+ newBot = iTop + rowSpan/2; -+ } -+ } -+ else if(iSplitType == vert_below) -+ { -+ newTop = iTop; -+ newBot = iBot -1; -+ } -+// -+// we need to get the location of where to place this cell. -+// -+ splitLeft = iLeft; -+ splitRight = iRight; -+ newLeft = iLeft; -+ newRight = iRight; -+ if(!bDoSplitSolidVert) -+ { -+ splitTop = newBot; -+ splitBot = iBot; -+ } -+ else -+ { -+ newTop = iTop; -+ newBot = newTop+1; -+ splitTop = newBot; -+ splitBot = splitTop+1; -+ } -+// -+// OK now we have to find the place to insert this. It should be the cell -+// immediately after (splitTop,splitLeft) -+// -+//(except if it's a splitSolidVert in which case it should be placed as the -+// next next on the row in the first cell before (splitleft,splittop) -+// -+ if(bDoSplitSolidVert) -+ { -+// -+// OK start with cellSDH and scan until we either reach the end of the table -+// or we find a cell past where splitcell should be. Then we insert the cell -+// at where cell just after splitcell is. -+// -+ bool bStop = false; -+ curSDH = cellSDH; -+ while(!bStop) -+ { -+ posCell = m_pDoc->getStruxPosition(curSDH)+1; -+ bRes = getCellParams(posCell,&jLeft,&jRight,&jTop,&jBot); -+ UT_ASSERT(bRes); -+ if(jTop >= splitTop) -+ { -+// -+// Found it! -+// -+ bStop = true; -+ posCell = m_pDoc->getStruxPosition(curSDH); -+ break; -+ } -+ bRes = m_pDoc->getNextStruxOfType(curSDH,PTX_SectionCell,&curSDH); -+ if(!bRes) -+ { -+ bStop = true; -+ posCell = m_pDoc->getStruxPosition(endTableSDH); -+ break; -+ } -+ posCell = m_pDoc->getStruxPosition(curSDH); -+ if(posCell > posEndTable) -+ { -+ bStop = true; -+ posCell = m_pDoc->getStruxPosition(endTableSDH); -+ break; -+ } -+ } -+ } -+ else -+ { -+ jTop = splitTop; -+ jBot = jTop+1; -+ jLeft = splitRight; -+ if(jLeft >= numCols) -+ { -+ jLeft = 0; -+ jTop += 1; -+ jBot +=1; -+ } -+ jRight = jLeft+1; -+ if(jTop >= numRows) -+ { -+// -+// Place right before endTable Strux -+// -+ if(endTableSDH == NULL) -+ { -+ // -+ // Disaster! the table structure in the piecetable is screwed. -+ // we're totally stuffed now. -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ return false; -+ } -+ posCell = m_pDoc->getStruxPosition(endTableSDH); -+ } -+ else -+ { -+// -+// now we have to loop until we find a cell precisely at jLeft,jTop -+// -+ bool bFound = false; -+ while(!bFound) -+ { -+ curSDH = m_pDoc-> getCellSDHFromRowCol(tableSDH,isShowRevisions(), getRevisionLevel(), jTop,jLeft); -+ if(curSDH == NULL) -+ { -+ endTableSDH = m_pDoc->getEndTableStruxFromTableSDH(tableSDH); -+ if(endTableSDH == NULL) -+ { -+ // -+ // Disaster! the table structure in the piecetable is screwed. -+ // we're totally stuffed now. -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ return false; -+ } -+ posCell = m_pDoc->getStruxPosition(endTableSDH); -+ bFound = true; -+ } -+ UT_sint32 kLeft,kRight,kTop,kBot; -+ PT_DocPosition posTmp = m_pDoc->getStruxPosition(curSDH)+1; -+ getCellParams(posTmp,&kLeft,&kRight,&kTop,&kBot); -+ if((kLeft == jLeft) && (kTop == jTop)) -+ { -+ bFound = true; -+ posCell = m_pDoc->getStruxPosition(curSDH); -+ } -+ else -+ { -+ jLeft++; -+ jRight++; -+ if(jLeft >= numCols) -+ { -+ jLeft = 0; -+ jTop++; -+ jRight =1; -+ jBot++; -+ } -+ if(jTop >= numRows) -+ { -+ endTableSDH = m_pDoc->getEndTableStruxFromTableSDH(tableSDH); -+ if(endTableSDH == NULL) -+ { -+ // -+ // Disaster! the table structure in the piecetable is screwed. -+ // we're totally stuffed now. -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ return false; -+ } -+ posCell = m_pDoc->getStruxPosition(endTableSDH); -+ bFound = true; -+ } -+ } -+ } -+ } -+ } -+ } -+// -+// OK build the table properties -+// -+ UT_String sRowTop = "top-attach"; -+ UT_String sRowBot = "bot-attach"; -+ UT_String sColLeft = "left-attach"; -+ UT_String sColRight = "right-attach"; -+ UT_String sTop,sBot,sLeft,sRight; -+ UT_String_sprintf(sTop,"%d",splitTop); -+ UT_String_sprintf(sBot,"%d",splitBot); -+ UT_String_sprintf(sLeft,"%d",splitLeft); -+ UT_String_sprintf(sRight,"%d",splitRight); -+ UT_String_setProperty(sCellProps,sRowTop,sTop); -+ UT_String_setProperty(sCellProps,sRowBot,sBot); -+ UT_String_setProperty(sCellProps,sColLeft,sLeft); -+ UT_String_setProperty(sCellProps,sColRight,sRight); -+ UT_DEBUGMSG(("Cells props for new cell:\n %s \n",sCellProps.c_str())); -+// -+// Insert the cell -+// -+ const gchar * atts[4] = {"props",NULL,NULL,NULL}; -+ atts[1] = sCellProps.c_str(); -+ bRes = m_pDoc->insertStrux(posCell,PTX_SectionCell,atts,NULL); -+ bRes = m_pDoc->insertStrux(posCell+1,PTX_Block); -+ posFirstInsert = posCell + 2; -+// -+// Save the cell SDH for later.. -+// -+ m_pDoc->getStruxOfTypeFromPosition(posCell+1,PTX_SectionCell,&prevCellSDH1); -+ -+ bRes = m_pDoc->insertStrux(posCell+2,PTX_EndCell); -+ -+// Changes the props of the new cell -+ UT_String_sprintf(sTop,"%d",newTop); -+ UT_String_sprintf(sBot,"%d",newBot); -+ UT_String_sprintf(sLeft,"%d",newLeft); -+ UT_String_sprintf(sRight,"%d",newRight); -+ UT_String_setProperty(sCellProps,sRowTop,sTop); -+ UT_String_setProperty(sCellProps,sRowBot,sBot); -+ UT_String_setProperty(sCellProps,sColLeft,sLeft); -+ UT_String_setProperty(sCellProps,sColRight,sRight); -+ posCell = m_pDoc->getStruxPosition(cellSDH)+1; -+ UT_DEBUGMSG(("New Cells props for old cell:\n %s \n",sCellProps.c_str())); -+ atts[1] = sCellProps.c_str(); -+ bool bres = m_pDoc->changeStruxFmt(PTC_AddFmt,posCell,posCell,atts,NULL,PTX_SectionCell); -+ m_pDoc->getStruxOfTypeFromPosition(posCell,PTX_SectionCell,&prevCellSDH2); if(bDoSplitSolidHori) -+ { -+// -+// OK now we have to adjust all the cells with left or right >= splitleft -+// If left of a given cell is < splitLeft it is not adjusted but the right -+// of the cell if it's > splitleft is incremented. In this way our new cell -+// span two columns -+// -+ UT_sint32 myleft,myright,mytop,mybot; -+// -+// start at the first cell and scan through the table adjusting each cell. -+// -+ bres = m_pDoc->getStruxOfTypeFromPosition(posTable+1,PTX_SectionCell,&cellSDH); -+ UT_ASSERT(bres); -+ bool bStop= false; -+ while(!bStop) -+ { -+ posCell = m_pDoc->getStruxPosition(cellSDH)+1; -+ bres = getCellParams(posCell,&myleft,&myright,&mytop,&mybot); -+ UT_ASSERT(bres); -+ bool bChange =false; -+ if((cellSDH == prevCellSDH1) || (cellSDH == prevCellSDH2)) -+ { -+// -+// Igore me! -+// -+ bChange = false; -+ } -+ else -+ { -+ if(myright> splitLeft) -+ { -+ myright++; -+ bChange = true; -+ } -+ if(myleft>splitLeft) -+ { -+ myleft++; -+ bChange = true; -+ } -+ if(bChange) -+ { -+// Changes the props of the cell -+ UT_String_sprintf(sTop,"%d",mytop); -+ UT_String_sprintf(sBot,"%d",mybot); -+ UT_String_sprintf(sLeft,"%d",myleft); -+ UT_String_sprintf(sRight,"%d",myright); -+ UT_String_setProperty(sCellProps,sRowTop,sTop); -+ UT_String_setProperty(sCellProps,sRowBot,sBot); -+ UT_String_setProperty(sCellProps,sColLeft,sLeft); -+ UT_String_setProperty(sCellProps,sColRight,sRight); -+ atts[1] = sCellProps.c_str(); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posCell,posCell,atts,NULL,PTX_SectionCell); -+ } -+ } -+ bRes = m_pDoc->getNextStruxOfType(cellSDH,PTX_SectionCell,&cellSDH); -+ if(!bRes) -+ { -+ bStop = true; -+ break; -+ } -+ posCell = m_pDoc->getStruxPosition(cellSDH); -+ if(posCell > posEndTable) -+ { -+ bStop = true; -+ break; -+ } -+ } -+ } -+ if(bDoSplitSolidVert) -+ { -+// -+// OK now we have to adjust all the cells with top or bot >= newTop -+// If top of a given cell is < newTop it is not adjusted but the bot -+// of the cell if it's > newTop is incremented. In this way our new cell -+// spans two rows -+// -+ UT_sint32 myleft,myright,mytop,mybot; -+// -+// start at the first cell and scan through the table adjusting each cell. -+// -+ m_pDoc->getStruxOfTypeFromPosition(posTable+1,PTX_SectionCell,&cellSDH); -+ bool bStop= false; -+ while(!bStop) -+ { -+ posCell = m_pDoc->getStruxPosition(cellSDH) +1; -+ getCellParams(posCell,&myleft,&myright,&mytop,&mybot); -+ bool bChange =false; -+ if((cellSDH == prevCellSDH1) || (cellSDH == prevCellSDH2)) -+ { -+// -+// Igore me! -+// -+ bChange = false; -+ } -+ else -+ { -+ if(mytop>newTop) -+ { -+ mytop++; -+ bChange = true; -+ } -+ if(mybot>newTop) -+ { -+ mybot++; -+ bChange = true; -+ } -+ if(bChange) -+ { -+// Changes the props of the cell -+ UT_String_sprintf(sTop,"%d",mytop); -+ UT_String_sprintf(sBot,"%d",mybot); -+ UT_String_sprintf(sLeft,"%d",myleft); -+ UT_String_sprintf(sRight,"%d",myright); -+ UT_String_setProperty(sCellProps,sRowTop,sTop); -+ UT_String_setProperty(sCellProps,sRowBot,sBot); -+ UT_String_setProperty(sCellProps,sColLeft,sLeft); -+ UT_String_setProperty(sCellProps,sColRight,sRight); -+ atts[1] = sCellProps.c_str(); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posCell,posCell,atts,NULL,PTX_SectionCell); -+ } -+ } -+ bRes = m_pDoc->getNextStruxOfType(cellSDH,PTX_SectionCell,&cellSDH); -+ if(!bRes) -+ { -+ bStop = true; -+ break; -+ } -+ posCell = m_pDoc->getStruxPosition(cellSDH); -+ if(posCell > posEndTable) -+ { -+ bStop = true; -+ break; -+ } -+ } -+ } -+ -+// -+// Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+// with the restored line-type property it has before. -+// -+ iListTag += 1; -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+// -+// OK finish everything off with the various parameters which allow the formatter to -+// be updated. -+// -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ -+ m_pDoc->endUserAtomicGlob(); -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+// Put the insertion point in a legal position -+// -+ setPoint(posFirstInsert); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+void FV_View::cmdSelectTOC(UT_sint32 x, UT_sint32 y) -+{ -+ UT_sint32 xClick=0,yClick = 0; -+ fp_Page* pPage = _getPageForXY(x,y,xClick,yClick); -+ fl_TOCLayout * pTOCL = pPage->getLastMappedTOC(); -+ UT_return_if_fail(pTOCL); -+ m_Selection.setTOCSelected(pTOCL); -+ PT_DocPosition pos = pTOCL->getPosition(); -+ m_iInsPoint = pos+1; -+ if(m_pG->getCaret()) -+ { -+ m_pG->getCaret()->disable(); -+ } -+ m_countDisable++; -+} -+ -+/*! -+ * Select the column of the table identified by the document position -+ * posOfColumn -+ */ -+bool FV_View::cmdSelectColumn(PT_DocPosition posOfColumn) -+{ -+ PL_StruxDocHandle cellSDH,tableSDH; -+ PT_DocPosition posTable,posCell; -+ UT_sint32 iLeft,iRight,iTop,iBot; -+ UT_sint32 Left,Right,Top,Bot; -+ bool bEOL = false; // added this stop compiler warning. Tomas -+ if(!isInTable(posOfColumn)) -+ { -+ return false; -+ } -+ if(!isSelectionEmpty()) -+ { -+ _clearSelection(); -+ _resetSelection(); -+ } -+ getCellParams(posOfColumn, &iLeft, &iRight,&iTop,&iBot); -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(posOfColumn,PTX_SectionCell,&cellSDH); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posOfColumn,PTX_SectionTable,&tableSDH); -+ UT_return_val_if_fail(bRes, false); -+ -+ posTable = m_pDoc->getStruxPosition(tableSDH) + 1; -+ posCell = m_pDoc->getStruxPosition(cellSDH); -+ -+// -+// Now find the number of rows and columns inthis table. -+// -+ UT_sint32 numRows = 0; -+ UT_sint32 numCols = 0; -+ m_pDoc->getRowsColsFromTableSDH(tableSDH, isShowRevisions(), getRevisionLevel(), &numRows, &numCols); -+// -+// Ok set the selection type to that of a column -+// -+ m_Selection.setMode(FV_SelectionMode_TableColumn); -+ -+ fl_BlockLayout * pBlock = NULL; -+ fp_Run * pRun = NULL; -+ UT_sint32 xCaret, yCaret; -+ UT_uint32 heightCaret; -+ UT_sint32 xCaret2, yCaret2; -+ bool bDirection; -+ _findPositionCoords(posOfColumn, bEOL, xCaret, yCaret, xCaret2, yCaret2, heightCaret, bDirection, &pBlock, &pRun); -+ UT_return_val_if_fail(pBlock,false); -+ fl_ContainerLayout * pCL = pBlock->myContainingLayout(); -+ UT_return_val_if_fail(pCL,false); -+ pCL = pCL->myContainingLayout(); -+ UT_return_val_if_fail(pCL,false); -+ UT_return_val_if_fail((pCL->getContainerType() == FL_CONTAINER_TABLE),false); -+ fl_TableLayout * pTL = static_cast(pCL); -+ m_Selection.setTableLayout(pTL); -+// -+// Now loop through the column and collect all the cells. -+// -+ UT_sint32 j = 0; -+ UT_sint32 jPrev = -1; -+ for(j=0; jgetPosition(false))); -+ fl_ContainerLayout * pCL = pBlock->myContainingLayout(); -+ UT_return_val_if_fail((pCL->getContainerType() == FL_CONTAINER_CELL),false); -+ fl_CellLayout * pCell = static_cast(pCL); -+ m_Selection.addCellToSelection(pCell); -+ jPrev = j; -+ } -+ PD_DocumentRange * pRange = getNthSelection(getNumSelections()-1); -+ _setPoint(pRange->m_pos2); -+ _drawSelection(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+/*! -+ * Convert a table to Text with each cell separated by commas, Tabs, -+ * or tabs and commas as follows: -+ * iSepType == 0 Use Commas -+ * iSepType == 1 Use Tabs -+ * iSepType == 2 Use Tabs and Commas -+ * We place a paragraph break at the end of of each row but otherwise we simply -+ * extract just the text from each cell. -+ */ -+bool FV_View::cmdTableToText(PT_DocPosition posSource,UT_sint32 iSepType) -+{ -+ fl_TableLayout * pTL = getTableAtPos(posSource); -+ if(pTL == NULL) -+ { -+ return false; -+ } -+ PL_StruxDocHandle tableSDH; -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(posSource,PTX_SectionTable,&tableSDH); -+ UT_return_val_if_fail(bRes, false); -+ PT_DocPosition posTable = m_pDoc->getStruxPosition(tableSDH) + 1; -+ -+// -+// Now find the number of rows and columns inthis table. -+// -+ UT_sint32 numRows = 0; -+ UT_sint32 numCols = 0; -+ m_pDoc->getRowsColsFromTableSDH(tableSDH, isShowRevisions(), getRevisionLevel(), &numRows, &numCols); -+ PT_DocPosition posInsert = pTL->getPosition(true); -+ -+ // Signal PieceTable Changes -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ setPoint(posInsert); -+ insertParagraphBreak(); -+ -+ UT_sint32 i,j =0; -+ fp_TableContainer * pTAB = static_cast(pTL->getFirstContainer()); -+ fp_CellContainer * pCCell = NULL; -+ fl_CellLayout * pCellL = NULL; -+ UT_GrowBufElement iComma = static_cast(','); -+ UT_GrowBufElement iTab = static_cast(UCS_TAB); -+ for(i=0;igetCellAtRowColumn(i,j); -+ if(pCCell == NULL) -+ { -+ continue; -+ } -+ pCellL = static_cast(pCCell->getSectionLayout()); -+ if(pCellL == NULL) -+ { -+ continue; -+ } -+ UT_GrowBuf buf; -+ buf.truncate(0); -+ pCellL->appendTextToBuf(buf); -+ if(iSepType == 0) -+ { -+ buf.append(&iComma,1); -+ } -+ else if(iSepType == 1) -+ { -+ buf.append(&iTab,1); -+ } -+ else if(iSepType == 2) -+ { -+ buf.append(&iTab,1); -+ buf.append(&iComma,1); -+ } -+ else -+ { -+ buf.append(&iTab,1); -+ buf.append(&iComma,1); -+ } -+ cmdCharInsert(reinterpret_cast(buf.getPointer(0)),buf.getLength()); -+ } -+ insertParagraphBreak(); -+ } -+ posTable = pTL->getPosition(true) + 2; -+ cmdDeleteTable(posTable, true); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+/*! -+ * Merge the cells located at posSource with posDestination by copying the data from -+ * source to destination. Then deleting source and expanding destination into it's location -+ * in the table. -+ */ -+bool FV_View::cmdMergeCells(PT_DocPosition posSource, PT_DocPosition posDestination) -+{ -+ UT_sint32 sLeft,sRight,sTop,sBot; -+ UT_sint32 dLeft,dRight,dTop,dBot; -+ UT_sint32 Left,Right,Top,Bot; // need these for working variables. -+ getCellParams(posSource,&sLeft,&sRight,&sTop,&sBot); -+ getCellParams(posDestination,&dLeft,&dRight,&dTop,&dBot); -+ -+ PT_DocPosition posTable,posWork; -+ PL_StruxDocHandle tableSDH; -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(posSource,PTX_SectionTable,&tableSDH); -+ UT_return_val_if_fail(bRes, false); -+ posTable = m_pDoc->getStruxPosition(tableSDH) + 1; -+ -+// -+// Now find the number of rows and columns inthis table. -+// -+ UT_sint32 numRows = 0; -+ UT_sint32 numCols = 0; -+ m_pDoc->getRowsColsFromTableSDH(tableSDH, isShowRevisions(), getRevisionLevel(), &numRows, &numCols); -+ bool bChanged = false; -+ UT_sint32 iLineType = 0; -+ -+// -+// Got all we need, now set things up to do the merge nicely -+// -+// -+// OK that's done, now do the merge -+// -+// Have to worry about merging cell spanning multiple rows and columns. We do this -+// by matching the the widths and heights of the source and destination cells. -+// -+ if((sLeft == dLeft) && (sTop == dTop)) -+ { -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ return false; -+ } -+ -+ if(sLeft == dLeft) -+ { -+// -+// Merge vertically -+// -+// might have d | | | | -+// ---------- -+// s | | -+// To solve this merge all top cells horizontally then merge this combined set vertically -+// -+// First check that top row ends at bottom row boundary. We reject attempts to merge cells -+// like this -+// d | | | | -+// ------------ -+// s | | -+ if(sRight >= dRight) -+ { -+ if(sRight < numCols -1) -+ { -+ posWork = findCellPosAt(posTable,dTop,sRight) +1; -+ getCellParams(posWork,&Left,&Right,&Top,&Bot); -+ if(Left != sRight) -+ { -+ // -+ // Right column of src cell doesn't match the row above it. Bail out. -+ // -+ // fixme: Put in a dialog to explain this to the user -+ // -+ return false; -+ } -+ } -+ // -+ // OK now merge all the cells in the destination cell together. -+ // -+ Left = dRight; -+ while(Left < sRight) -+ { -+ posWork = findCellPosAt(posTable,dTop,Left) +1; -+ getCellParams(posWork,&Left,&Right,&Top,&Bot); -+// -+// Do the merge without all the undo/update trimings -+// append onto destination -+ if(!bChanged) -+ { -+ iLineType = _changeCellParams(posTable, tableSDH); -+ } -+ bChanged = true; -+ _MergeCells(posDestination,posWork,false); -+ Left = Right; -+ } -+// -+// Now merge the merged destination into the source -+// -+ if(!bChanged) -+ { -+ iLineType = _changeCellParams(posTable, tableSDH); -+ } -+ bChanged = true; -+ posSource = findCellPosAt(posTable,sTop,sLeft) +1; -+ posDestination = findCellPosAt(posTable,dTop,dLeft) +1; -+ _MergeCells(posDestination,posSource,true); -+ } -+ else -+ { -+// -+// Here we have this scenario: -+// -+// d | | -+// ------------ -+// s | | | | -+// -+// ie destination is narrower than the source -+// -+// check that the source column lines up with the destination column. -+// -+ if(dRight < numCols -1) -+ { -+ posWork = findCellPosAt(posTable,sTop,dRight) +1; -+ getCellParams(posWork,&Left,&Right,&Top,&Bot); -+ if(Left != dRight) -+ { -+ // -+ // Right column of src cell doesn't match the row above it. Bail out. -+ // fixme: Put in a dialog to explain this to the user -+ // -+ return false; -+ } -+ } -+ // -+ // OK now merge all the cells in the src cell together. -+ // -+ Left = sRight; -+ while(Left < dRight) -+ { -+ posWork = findCellPosAt(posTable,sTop,Left) +1; -+ getCellParams(posWork,&Left,&Right,&Top,&Bot); -+// -+// Do the merge without all the undo/update trimings -+// -+ if(!bChanged) -+ { -+ iLineType = _changeCellParams(posTable, tableSDH); -+ } -+ bChanged = true; -+ _MergeCells(posSource,posWork,false); -+ Left = Right; -+ } -+// -+// Now merge the merged destination into the source -+// -+ if(!bChanged) -+ { -+ iLineType = _changeCellParams(posTable, tableSDH); -+ } -+ bChanged = true; -+ posSource = findCellPosAt(posTable,sTop,sLeft) +1; -+ posDestination = findCellPosAt(posTable,dTop,dLeft) +1; -+ _MergeCells(posDestination,posSource,true); -+ } -+ } -+ else if(sTop == dTop) -+ { -+// -+// Merge horizontally -+// -+// might have rows spanning several columns -+// d s -+// --------- -+// | | | -+// | ----- -+// | | | -+// | ----- -+// | | | -+// --------- -+// To solve this merge all cells vertically then merge this combined set horizontally -+// -+// First check that left column ends at right column boundary. -+// We reject attempts to merge cells that don't have this condition. -+// ie this: -+// d s -+// --------- -+// | | | -+// | ----- -+// | | | -+// | ----- -+// | | | -+// | ----- -+// |---| | -+// | ----- -+// -+ if(dBot >= sBot) -+ { -+ if(dBot < numRows -1) -+ { -+ posWork = findCellPosAt(posTable,dBot,sLeft) +1; -+ getCellParams(posWork,&Left,&Right,&Top,&Bot); -+ if(Top != dBot) -+ { -+ // -+ // Bot col of src cell doesn't match the column before. Bail out. -+ // -+ // fixme: Put in a dialog to explain this to the user -+ // -+ return false; -+ } -+ } -+ // -+ // OK now merge all the cells right of the src cell together. -+ // -+ Bot = sBot; -+ Top = sBot; -+ while(Top < dBot) -+ { -+ posWork = findCellPosAt(posTable,Top,sLeft) +1; -+ getCellParams(posWork,&Left,&Right,&Top,&Bot); -+// -+// Do the merge without all the undo/update trimings -+// -+ if(!bChanged) -+ { -+ iLineType = _changeCellParams(posTable, tableSDH); -+ } -+ bChanged = true; -+ _MergeCells(posSource,posWork,false); -+ UT_ASSERT(Bot > Top); -+ if(Bot <= Top) -+ { -+ break; -+ } -+ Top = Bot; -+ } -+// -+// Now merge the merged destination into the source -+// -+ if(!bChanged) -+ { -+ iLineType = _changeCellParams(posTable, tableSDH); -+ } -+ bChanged = true; -+ posSource = findCellPosAt(posTable,sTop,sLeft) +1; -+ posDestination = findCellPosAt(posTable,dTop,dLeft) +1; -+ _MergeCells(posDestination,posSource,true); -+ } -+ else -+ { -+// -+// Here we have this scenario: -+// -+// -+// might have rows spanning several columns -+// d s -+// --------- -+// | | | -+// ----- | -+// | | | -+// ----- | -+// | | | -+// --------- -+// To solve this merge all cells vertically then merge this combined set horizontally -+// -+// First check that left column ends at right column boundary. -+// We reject attempts to merge cells that don't have this condition. -+// ie this: -+// d s -+// --------- -+// | | | -+// ----| | -+// | | | -+// ----| | -+// | | | -+// | | | -+// |---| | -+// | ----- -+// -+ -+ if(sBot < numRows -1) -+ { -+ posWork = findCellPosAt(posTable,sBot,dLeft) +1; -+ getCellParams(posWork,&Left,&Right,&Top,&Bot); -+ if(Top != sBot) -+ { -+ // -+ // Right column of src cell doesn't match the row above it. Bail out. -+ // -+ // fixme: Put in a dialog to explain this to the user -+ // -+ return false; -+ } -+ } -+ // -+ // OK now merge all the cells above the src cell together. -+ // -+ Top = dBot; -+ while(Top < sBot) -+ { -+ posWork = findCellPosAt(posTable,Top,dLeft) + 1; -+ getCellParams(posWork,&Left,&Right,&Top,&Bot); -+// -+// Do the merge without all the undo/update trimings -+// -+ if(!bChanged) -+ { -+ iLineType = _changeCellParams(posTable, tableSDH); -+ } -+ bChanged = true; -+ _MergeCells(posDestination,posWork,false); -+ Top = Bot; -+ } -+// -+// Now merge the source into the merged destination -+// -+ if(!bChanged) -+ { -+ iLineType = _changeCellParams(posTable, tableSDH); -+ } -+ bChanged = true; -+ posSource = findCellPosAt(posTable,sTop,sLeft) +1; -+ posDestination = findCellPosAt(posTable,dTop,dLeft) +1; -+ _MergeCells(posDestination,posSource,true); -+ } -+ } -+ else -+ { -+// -+// Neight left or top align of the cells to be merged. -+// bali out -+ -+ return false; -+ } -+// -+// Now check if we've merged a whole row of height 2 or a whole col of width two// -+// Start with whole row. -+// -+ posDestination = findCellPosAt(posTable,dTop,dLeft) +2; -+ getCellParams(posDestination,&dLeft,&dRight,&dTop,&dBot); -+ UT_sint32 origTop = dTop; -+ if((dLeft==0) && (dRight== numCols)) -+ { -+// -+// Yep one whole row merged. -+// -+// Look for the number of rows spanned now -+// -+ if(dBot > (dTop+1)) -+ { -+// -+// Yep we have problem, we'll fix it. Subtract this number from all the cells -+// top and Bottom attach -+// -+ UT_sint32 diff = dBot - dTop -1; -+ PL_StruxDocHandle sdhCell = NULL; -+ PL_StruxDocHandle sdhNextCell = NULL; -+ PL_StruxDocHandle sdhEndTable = NULL; -+ PT_DocPosition posEndTable = 0; -+ PT_DocPosition posCell = 0; -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posDestination,PTX_SectionCell,&sdhCell); -+ UT_return_val_if_fail(bRes,false); -+ sdhEndTable = m_pDoc->getEndTableStruxFromTableSDH(tableSDH); -+ UT_return_val_if_fail(sdhEndTable,false); -+ posEndTable = m_pDoc->getStruxPosition(sdhEndTable); -+ bool bKeepGoing = true; -+ while(bKeepGoing) -+ { -+ posCell = m_pDoc->getStruxPosition(sdhCell)+1; -+ getCellParams(posCell,&dLeft,&dRight,&dTop,&dBot); -+ dBot -= diff; -+ UT_sint32 row = dTop; -+ if(dTop != origTop) -+ { -+ dTop -= diff; -+ } -+ _changeCellTo(posTable,row,dLeft,dLeft,dRight,dTop,dBot); -+ -+ bRes = m_pDoc->getNextStruxOfType(sdhCell,PTX_SectionCell,&sdhNextCell); -+ PT_DocPosition posNextCell = 0; -+ if(bRes) -+ { -+ posNextCell = m_pDoc->getStruxPosition(sdhNextCell); -+ if(posNextCell > posEndTable) -+ { -+ posNextCell = 0; -+ bKeepGoing = false; -+ break; -+ } -+ } -+ else -+ { -+ bKeepGoing = false; -+ break; -+ } -+ sdhCell = sdhNextCell; -+ } -+ -+ } -+ } -+// -+// Look for a whole merged column -+// -+ if((dTop==0) && (dBot == numRows)) -+ { -+// -+// Yep one whole col merged. -+// -+// Look for the number of cols spanned now -+// -+ if(dRight > (dLeft+1)) -+ { -+// -+// Yep we have problem, we'll fix it. Subtract this number from all the cells -+// Right attach from this cell and left and right for all cells to the right -+// of it -+// This is a bit tricky -+// because we don't want to subtract the difference twice so we'll make a -+// vector of unique cell sdh's and only do our thing one those that aren't in -+// it -+// -+ UT_sint32 diff = dRight - dLeft -1; -+ UT_sint32 origLeft = dLeft; -+ UT_sint32 origRight = dRight; -+ PL_StruxDocHandle sdhCell = NULL; -+ PT_DocPosition posCell = 0; -+ UT_GenericVector vecCells; -+ posCell = findCellPosAt(posTable, dTop, dLeft)+1; -+ m_pDoc->getStruxOfTypeFromPosition(posCell,PTX_SectionCell,&sdhCell); -+ vecCells.addItem(sdhCell); -+ getCellParams(posCell,&dLeft,&dRight,&dTop,&dBot); -+ dRight -= diff; -+ _changeCellTo(posTable,dTop,dLeft,dLeft,dRight,dTop,dBot); -+ UT_sint32 row,col=0; -+ for (col = 0; col < numCols; col++) -+ { -+ for(row =0; row < numRows;row++) -+ { -+ posCell = findCellPosAt(posTable, row, col)+1; -+ m_pDoc->getStruxOfTypeFromPosition(posCell,PTX_SectionCell,&sdhCell); -+ if((sdhCell==NULL) || (vecCells.findItem(sdhCell) >= 0)) -+ { -+ continue; -+ } -+ getCellParams(posCell,&dLeft,&dRight,&dTop,&dBot); -+ bool bDoIt = false; -+ if(dLeft > origLeft) -+ { -+ dLeft -= diff; -+ bDoIt = true; -+ } -+ if(dRight >= origRight) -+ { -+ dRight -= diff; -+ bDoIt = true; -+ } -+ if(bDoIt) -+ { -+ vecCells.addItem(sdhCell); -+ _changeCellTo(posTable,row,col,dLeft,dRight,dTop,dBot); -+ } -+ } -+ } -+ } -+ } -+// -+// Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+// with the restored line-type property it has before. -+// -+ iLineType += 1; -+ _restoreCellParams(posTable,iLineType); -+ setPoint(posDestination); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+ -+/*! -+ * Mve the caret to the next or previous cell in a table. If at either end -+ * insert a new row. -+ */ -+bool FV_View::cmdAdvanceNextPrevCell(bool bGoNext) -+{ -+ if(!isInTable()) -+ { -+ return false; -+ } -+ PL_StruxDocHandle sdhCell = NULL; -+ PL_StruxDocHandle sdhNextPrevCell = NULL; -+ PL_StruxDocHandle sdhTable = NULL; -+ PL_StruxDocHandle sdhEndTable = NULL; -+ PT_DocPosition posTable = 0; -+ PT_DocPosition posEndTable = 0; -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(getPoint(),PTX_SectionTable,&sdhTable); -+ UT_return_val_if_fail(bRes,false); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(getPoint(),PTX_SectionCell,&sdhCell); -+ UT_return_val_if_fail(bRes,false); -+ if(bGoNext) -+ { -+ sdhEndTable = m_pDoc->getEndTableStruxFromTableSDH(sdhTable); -+ UT_return_val_if_fail(sdhEndTable,false); -+ posEndTable = m_pDoc->getStruxPosition(sdhEndTable); -+ bRes = m_pDoc->getNextStruxOfType(sdhCell,PTX_SectionCell,&sdhNextPrevCell); -+ PT_DocPosition posNextCell = 0; -+ if(bRes) -+ { -+ posNextCell = m_pDoc->getStruxPosition(sdhNextPrevCell); -+ if(posNextCell > posEndTable) -+ { -+ posNextCell = 0; -+ } -+ } -+ if(posNextCell == 0) -+ { -+ cmdInsertRow(getPoint(),false); -+ return true; -+ } -+ setPoint(posNextCell+2); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ return true; -+ } -+ bRes = m_pDoc->getPrevStruxOfType(sdhCell,PTX_SectionCell,&sdhNextPrevCell); -+ PT_DocPosition posPrevCell = 0; -+ if(bRes) -+ { -+ posPrevCell = m_pDoc->getStruxPosition(sdhNextPrevCell); -+ if(posPrevCell < posTable) -+ { -+ cmdInsertRow(getPoint(),true); -+ return true; -+ } -+ setPoint(posPrevCell+2); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ return true; -+ } -+ if(posPrevCell == 0) -+ { -+ cmdInsertRow(getPoint(),true); -+ return true; -+ } -+ -+ return false; -+} -+ -+bool FV_View::cmdTextToTable(bool bIgnoreSpaces) -+{ -+ if(isSelectionEmpty()) -+ { -+ return false; -+ } -+ if(isInHdrFtr(getPoint())) -+ { -+ return false; -+ } -+ if(getSelectionMode() != FV_SelectionMode_Single) -+ { -+ return false; -+ } -+ UT_GenericVector vecBlocks; -+ getBlocksInSelection(&vecBlocks); -+ fl_BlockLayout * pBL = vecBlocks.getNthItem(0); -+ if(pBL == NULL) -+ { -+ return false; -+ } -+ UT_GrowBuf * pBuf = new UT_GrowBuf(1024); -+ UT_uint32 numCols = 0; -+ PT_DocPosition posStart = pBL->getPosition(false); -+ PT_DocPosition begPos = posStart; -+ PT_DocPosition endPos = posStart; -+ pBL->getBlockBuf(pBuf); -+ UT_UTF8String sWords; -+ bool bGetNext = true; -+ while(bGetNext) -+ { -+ bGetNext = pBL->getNextTableElement(pBuf,posStart,begPos,endPos, sWords, bIgnoreSpaces); -+ if(begPos != 0) -+ { -+ numCols++; -+ posStart = endPos+1; -+ } -+ } -+ if(numCols == 0) -+ { -+ return false; -+ } -+ UT_uint32 numRows = vecBlocks.getItemCount(); -+ if(numRows == 0) -+ { -+ return false; -+ } -+ pBL = vecBlocks.getNthItem(numRows-1); -+ PT_DocPosition posTableStart = pBL->getPosition(true) + pBL->getLength(); -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ _clearSelection(); -+ setPoint(posTableStart); -+ UT_Error e = UT_OK; -+// -+// OK let's create that table now! -+// -+// -+// insert a block to terminate the text before this. -+// -+ PT_DocPosition pointBreak = getPoint(); -+ PT_DocPosition pointTable = 0; -+ e = m_pDoc->insertStrux(getPoint(),PTX_Block); -+// -+// Insert the table strux at the same spot. This will make the table link correctly in the -+// middle of the broken text. -+// -+// Handle special case of not putting a table immediately after a section break -+// -+ PL_StruxDocHandle secSDH = NULL; -+ bool bres = m_pDoc->getStruxOfTypeFromPosition(pointBreak-1,PTX_Section,&secSDH); -+ PT_DocPosition secPos = m_pDoc->getStruxPosition(secSDH); -+ UT_DEBUGMSG(("SEVIOR: SecPos %d pointBreak %d \n",secPos,pointBreak)); -+ secSDH = NULL; -+ bres = m_pDoc->getStruxOfTypeFromPosition(pointBreak,PTX_SectionCell,&secSDH); -+ if(secSDH != NULL) -+ { -+ PT_DocPosition secPos = m_pDoc->getStruxPosition(secSDH); -+ UT_DEBUGMSG(("SEVIOR: Cell Pos %d pointBreak %d \n",secPos,pointBreak)); -+ } -+ setPoint(pointBreak); -+ e |= static_cast(m_pDoc->insertStrux(getPoint(),PTX_SectionTable,NULL,NULL)); -+// -+// stuff for cell insertion. -+// -+ UT_uint32 i,j; -+ const gchar * attrs[3] = {"style","Normal",NULL}; -+ const gchar * props[9] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; -+ UT_String sRowTop = "top-attach"; -+ UT_String sRowBot = "bot-attach"; -+ UT_String sColLeft = "left-attach"; -+ UT_String sColRight = "right-attach"; -+ UT_String sTop,sBot,sLeft,sRight; -+ for(i=0;i(m_pDoc->insertStrux(getPoint(),PTX_SectionCell,NULL,props)); -+ pointBreak = getPoint(); -+ e |= static_cast(m_pDoc->insertStrux(getPoint(),PTX_Block,attrs,NULL)); -+ UT_DEBUGMSG(("SEVIOR: 4 cur point %d \n",getPoint())); -+ if(getPoint() == pointBreak) -+ { -+ setPoint(pointBreak+1); -+ } -+ if(i == 0 && j==0) -+ { -+ pointTable = getPoint(); -+ } -+ e |= static_cast(m_pDoc->insertStrux(getPoint(),PTX_EndCell)); -+ } -+ } -+ e |= static_cast(m_pDoc->insertStrux(getPoint(),PTX_EndTable)); -+// -+// Done! Now fill it. -+// -+ posTableStart +=3; -+ PL_StruxDocHandle sdhTable = NULL; -+ PL_StruxDocHandle sdhCell = NULL; -+ bool b =m_pDoc->getStruxOfTypeFromPosition(posTableStart,PTX_SectionTable,&sdhTable); -+ UT_return_val_if_fail(b,false); -+ PT_DocPosition posCell = posTableStart; -+ delete pBuf; -+ for(i =0; i< numRows;i++) -+ { -+ pBL = vecBlocks.getNthItem(i); -+ pBuf = new UT_GrowBuf(1024); -+ pBL->getBlockBuf(pBuf); -+ posStart = pBL->getPosition(false); -+ bool bEnd = false; -+ for( j = 0; !bEnd && j < numCols; j++) -+ { -+ sdhCell = m_pDoc->getCellSDHFromRowCol(sdhTable,isShowRevisions(),PD_MAX_REVISION,i,j); -+ posCell = m_pDoc->getStruxPosition(sdhCell)+1; // Points at block -+ sWords.clear(); -+ bEnd = !pBL->getNextTableElement(pBuf,posStart, begPos, endPos, sWords, bIgnoreSpaces); -+ if(begPos == endPos) -+ { -+ posStart = endPos+1; -+ continue; -+ } -+ if(((j < numCols-1) && (begPos > 0)) || ((j == numCols-1) && (endPos - pBL->getPosition(false)) >= pBuf->getLength())) -+ { -+ copyToLocal(begPos, endPos); -+ _pasteFromLocalTo(posCell+1); -+ posStart = endPos+1; -+ } -+ else if((j==numCols-1) && (begPos > 0)) -+ { -+ copyToLocal(begPos, endPos); -+ _pasteFromLocalTo(posCell+1); -+ posStart = endPos+1; -+ break; -+ } -+ } -+ delete pBuf; -+ } -+ pBL = vecBlocks.getNthItem(0); -+ begPos = pBL->getPosition(); -+ pBL = vecBlocks.getNthItem(numRows-1); -+ endPos = pBL->getPosition(true) + pBL->getLength(); -+ UT_uint32 iRealDeleteCount; -+ -+ m_pDoc->deleteSpan(begPos,endPos,NULL,iRealDeleteCount); -+ -+ -+ // Signal PieceTable Changes have finished -+ while(m_iPieceTableState > 0) -+ _restorePieceTableState(); -+ -+ _restorePieceTableState(); -+ m_pDoc->clearDoingPaste(); -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ -+ _generalUpdate(); -+ -+ m_pDoc->endUserAtomicGlob(); -+ -+ -+ setPoint(posTableStart); -+ PT_DocPosition posEOD; -+ bool bRes; -+ bRes = getEditableBounds(true, posEOD); -+ while(!isPointLegal() && getPoint() < posEOD) -+ { -+ setPoint(getPoint()+1); -+ } -+ while(!isPointLegal() && (getPoint() > 2)) -+ { -+ setPoint(getPoint()-1); -+ } -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+// -+// We're done! -+// -+ return true; -+} -+/*! -+ * Make a table columns autosizing by removing all the column properties. -+ */ -+bool FV_View::cmdAutoSizeCols(void) -+{ -+// -+// Got all we need, now set things up to do the delete nicely -+// -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ const char * pszTable[3] = {NULL,NULL,NULL}; -+ pszTable[0] = "table-column-props"; -+ pszTable[1] = "1"; -+ m_pDoc->changeStruxFmt(PTC_RemoveFmt,getPoint(),getPoint(),NULL,pszTable,PTX_SectionTable); -+ pszTable[0] = "table-column-leftpos"; -+ m_pDoc->changeStruxFmt(PTC_RemoveFmt,getPoint(),getPoint(),NULL,pszTable,PTX_SectionTable); -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+ -+/*! -+ * Make a table Rows autosizing by removing all the row properties. -+ */ -+bool FV_View::cmdAutoSizeRows(void) -+{ -+// -+// Got all we need, now set things up to do the delete nicely -+// -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ const char * pszTable[3] = {NULL,NULL,NULL}; -+ pszTable[0] = "table-row-heights"; -+ pszTable[1] = "1"; -+ pszTable[2] = NULL; -+ m_pDoc->changeStruxFmt(PTC_RemoveFmt,getPoint(),getPoint(),NULL,pszTable,PTX_SectionTable); -+ pszTable[0] = "table-column-leftpos"; -+ m_pDoc->changeStruxFmt(PTC_RemoveFmt,getPoint(),getPoint(),NULL,pszTable,PTX_SectionTable); -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+ -+/*! -+ * Make a table Rows autosizing by removing all the row and col properties. -+ */ -+bool FV_View::cmdAutoFitTable(void) -+{ -+// -+// Got all we need, now set things up to do the delete nicely -+// -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ const char * pszTable[7] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL}; -+ pszTable[0] = "table-row-heights"; -+ pszTable[1] = "1"; -+ pszTable[2] = "table-column-leftpos"; -+ pszTable[3] = "1"; -+ pszTable[4] = "table-column-props"; -+ pszTable[5] = "1"; -+ -+ m_pDoc->changeStruxFmt(PTC_RemoveFmt,getPoint(),getPoint(),NULL,pszTable,PTX_SectionTable); -+ pszTable[0] = "homogeneous"; -+ pszTable[1] = "1"; -+ pszTable[2] = NULL; -+ pszTable[3] = NULL; -+ -+ m_pDoc->changeStruxFmt(PTC_AddFmt,getPoint(),getPoint(),NULL,pszTable,PTX_SectionTable); -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+ -+ -+/*! -+ * Insert a column containing the position posCol, insert the column before the -+ * current column. -+ */ -+bool FV_View::cmdInsertCol(PT_DocPosition posCol, bool bBefore) -+{ -+ PL_StruxDocHandle cellSDH,tableSDH,endTableSDH,endCellSDH,prevCellSDH; -+ PT_DocPosition posTable,posCell,posEndCell,posPrevCell,posFirstInsert; -+ UT_sint32 numColsForInsertion = getNumColumnsInSelection(); -+ if(numColsForInsertion == 0) -+ { -+ return false; -+ } -+ posFirstInsert = 0; -+ UT_sint32 iLeft,iRight,iTop,iBot; -+ getCellParams(posCol, &iLeft, &iRight,&iTop,&iBot); -+ UT_sint32 iColInsertAt =0; -+ -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(posCol,PTX_SectionCell,&cellSDH); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posCol,PTX_SectionTable,&tableSDH); -+ UT_return_val_if_fail(bRes, false); -+ -+ posTable = m_pDoc->getStruxPosition(tableSDH) + 1; -+// -+// Now find the number of rows and columns in this table. -+// -+ UT_sint32 numRows = 0; -+ UT_sint32 numCols = 0; -+ UT_sint32 i = 0; -+ m_pDoc-> getRowsColsFromTableSDH(tableSDH, isShowRevisions(), getRevisionLevel(), &numRows, &numCols); -+ if(!bBefore) -+ { -+ for(i=0;i iColInsertAt) -+ { -+ iColInsertAt = jRight -1; -+ } -+ } -+ } -+ else -+ { -+ iColInsertAt = 99999999; -+ for(i=0;idisableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ if (!isSelectionEmpty()) -+ { -+ _clearSelection(); -+ } -+ m_pDoc->setDontImmediatelyLayout(true); -+// -+// Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+// with a bogus line-type property. We'll restore it later. -+// -+ const char * pszTable[3] = {NULL,NULL,NULL}; -+ pszTable[0] = "list-tag"; -+ const char * szListTag = NULL; -+ UT_String sListTag; -+ UT_sint32 iListTag; -+ m_pDoc->getPropertyFromSDH(tableSDH,isShowRevisions(),getRevisionLevel(),pszTable[0],&szListTag); -+ if(szListTag == NULL || *szListTag == '\0') -+ { -+ iListTag = 0; -+ } -+ else -+ { -+ iListTag = atoi(szListTag); -+ iListTag -= 1; -+ } -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG((" Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+// -+// OK loop through all the rows in this column and insert the entries in the specified -+// column if the cell spans just the width of the column.. -+// -+ UT_sint32 oldTop = -1; -+ UT_sint32 ii = 0; -+ for(ii=0; ii= numCols) -+ { -+ posCell = findCellPosAt(posTable,i,numCols-1); -+ } -+ else -+ { -+ posCell = findCellPosAt(posTable,i,iColInsertAt); -+ } -+ UT_ASSERT(posCell > 0); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posCell+1,PTX_SectionCell,&cellSDH); -+ UT_sint32 Left,Right,Top,Bot; -+ getCellParams(posCell+1,&Left,&Right,&Top,&Bot); -+ UT_DEBUGMSG(("SEVIOR: Before Insert column left %d right %d top %d bot %d \n",Left,Right,Top,Bot)); -+ const gchar * props[9] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; -+ UT_String sRowTop = "top-attach"; -+ UT_String sRowBot = "bot-attach"; -+ UT_String sColLeft = "left-attach"; -+ UT_String sColRight = "right-attach"; -+ UT_String sTop,sBot,sLeft,sRight; -+ UT_String_sprintf(sTop,"%d",i); -+ UT_String_sprintf(sBot,"%d",i+1); -+ props[0] = sRowTop.c_str(); -+ props[1] = sTop.c_str(); -+ props[2] = sRowBot.c_str(); -+ props[3] = sBot.c_str(); -+ bool bBBefore = false; -+ bool bAfter = false; -+ if(((Bot - Top) > 1) && (oldTop != Top)) -+ { -+ oldTop = Top; -+ } -+ if((Bot - Top) == 1) -+ { -+ if(bBefore) -+ { -+ if(iColInsertAt > 0) -+ { -+ PT_DocPosition posCellLeft = findCellPosAt(posTable,i,iColInsertAt-1); -+ UT_sint32 jLeft,jRight,jTop,jBot; -+ getCellParams(posCellLeft+1,&jLeft,&jRight,&jTop,&jBot); -+ UT_String_sprintf(sLeft,"%d",jRight); -+ UT_String_sprintf(sRight,"%d",jRight+1); -+ } -+ else -+ { -+ UT_String_sprintf(sLeft,"%d",0); -+ UT_String_sprintf(sRight,"%d",1); -+ } -+ props[4] = sColLeft.c_str(); -+ props[5] = sLeft.c_str(); -+ props[6] = sColRight.c_str(); -+ props[7] = sRight.c_str(); -+ bRes = m_pDoc->insertStrux(posCell,PTX_SectionCell,NULL,props); -+ bRes = m_pDoc->insertStrux(posCell+1,PTX_Block); -+ if(i == 0) -+ { -+ posFirstInsert = posCell + 2; -+ } -+ bRes = m_pDoc->insertStrux(posCell+2,PTX_EndCell); -+ } -+ else -+ { -+// -+// iColInsertAt gives the cell just to the right of the requested cell. -+// We need to insert just before this point - unless this is the last column -+// on the row in which case we need to insert after the endCell strux. -+// -+ PT_DocPosition posCellLeft = 0; -+ posCellLeft = findCellPosAt(posTable,i,iColInsertAt); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posCellLeft+1,PTX_SectionCell,&cellSDH); -+ endCellSDH = m_pDoc->getEndCellStruxFromCellSDH(cellSDH); -+ posEndCell = m_pDoc->getStruxPosition(endCellSDH); -+ posCellLeft = posEndCell+1; -+ UT_sint32 jLeft,jRight,jTop,jBot; -+ getCellParams(posCellLeft+1,&jLeft,&jRight,&jTop,&jBot); -+ UT_String_sprintf(sLeft,"%d",iColInsertAt+1); -+ UT_String_sprintf(sRight,"%d",iColInsertAt+2); -+ props[4] = sColLeft.c_str(); -+ props[5] = sLeft.c_str(); -+ props[6] = sColRight.c_str(); -+ props[7] = sRight.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Inserting cell strux %s %s %s %s %s %s %s %s \n",props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7])); -+ bRes = m_pDoc->insertStrux(posCellLeft,PTX_SectionCell,NULL,props); -+ bRes = m_pDoc->insertStrux(posCellLeft+1,PTX_Block); -+ if(i == 0) -+ { -+ posFirstInsert = posCellLeft + 2; -+ } -+ -+ bRes = m_pDoc->insertStrux(posCellLeft+2,PTX_EndCell); -+ -+ } -+ } -+ else -+ { -+// -+// OK we have to work to find the right place to insert the cell. -+// -+ UT_sint32 jLeft,jRight,jTop,jBot; -+ if(bBefore) -+ { -+// -+// find first cell on this row with left coordinate == or greater than -+// iInsertColAt. -+// -+ UT_sint32 j =0; -+ UT_sint32 k = i; -+ for(k=i; k < numRows && !bBBefore; k++) -+ { -+ if( k == i) -+ { -+ j = iColInsertAt; -+ } -+ else -+ { -+ j = 0; -+ } -+ while(j < numCols && !bBBefore) -+ { -+ posCell = findCellPosAt(posCol,k,j); -+ getCellParams(posCell+1,&jLeft,&jRight,&jTop,&jBot); -+ if(jTop == i) -+ { -+ bBBefore = true; -+ UT_String_sprintf(sLeft,"%d",iColInsertAt); -+ UT_String_sprintf(sRight,"%d",iColInsertAt+1); -+ props[4] = sColLeft.c_str(); -+ props[5] = sLeft.c_str(); -+ props[6] = sColRight.c_str(); -+ props[7] = sRight.c_str(); -+// -+// Insert at Previous cell it will push that cell to one position later. -+// -+ bRes = m_pDoc->insertStrux(posCell,PTX_SectionCell,NULL,props); -+ bRes = m_pDoc->insertStrux(posCell+1,PTX_Block); -+ if(i == 0) -+ { -+ posFirstInsert = posCell + 2; -+ } -+ bRes = m_pDoc->insertStrux(posCell+2,PTX_EndCell); -+ } -+ j++; -+ } -+ } -+ UT_ASSERT(bBBefore); -+ } -+// -+// Insert column after this column -+// -+ else -+ { -+// -+// OK we have to work to find the right place to insert the cell. -+// -+ UT_sint32 jLeft,jRight,jTop,jBot; -+// -+// Now look after this cell for a column to place this. -+// -+ bAfter = false; -+ bBBefore = false; -+ UT_sint32 j=0; -+ UT_sint32 k =i; -+ for(k=i; k < numRows && !bAfter; k++) -+ { -+ if(k == i) -+ { -+ j = iColInsertAt; -+ } -+ else -+ { -+ j = 0; -+ } -+ while((j< numCols) && !bAfter) -+ { -+ posCell = findCellPosAt(posCol,k,j); -+ getCellParams(posCell+1,&jLeft,&jRight,&jTop,&jBot); -+ if(jTop == i) -+ { -+ bAfter = true; -+// -+// iColInsertAt gives the cell just to the right of the requested cell. -+// We need to insert just before this point - unless this is the last column -+// on the row in which case we need to insert after the endCell strux. -+// -+ PT_DocPosition posCellLeft = 0; -+ posCellLeft = findCellPosAt(posTable,k,j); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posCellLeft+1,PTX_SectionCell,&cellSDH); -+ if(jLeft <= iColInsertAt) -+ { -+ endCellSDH = m_pDoc->getEndCellStruxFromCellSDH(cellSDH); -+ posEndCell = m_pDoc->getStruxPosition(endCellSDH); -+ posCellLeft = posEndCell+1; -+ } -+ endCellSDH = m_pDoc->getEndCellStruxFromCellSDH(cellSDH); -+ posEndCell = m_pDoc->getStruxPosition(endCellSDH); -+ UT_String_sprintf(sLeft,"%d",iColInsertAt+1); -+ UT_String_sprintf(sRight,"%d",iColInsertAt+2); -+ props[4] = sColLeft.c_str(); -+ props[5] = sLeft.c_str(); -+ props[6] = sColRight.c_str(); -+ props[7] = sRight.c_str(); -+ bRes = m_pDoc->insertStrux(posCellLeft,PTX_SectionCell,NULL,props); -+ bRes = m_pDoc->insertStrux(posCellLeft+1,PTX_Block); -+ if(i == 0) -+ { -+ posFirstInsert = posCellLeft + 2; -+ } -+ bRes = m_pDoc->insertStrux(posCellLeft+2,PTX_EndCell); -+ } -+ j++; -+ } -+ } -+ UT_ASSERT(bAfter); -+ } -+ } -+ } -+// -+// OK now increment the cell container attach points for the cells after the inserted cells -+// -+ bRes = m_pDoc->getNextStruxOfType(tableSDH,PTX_EndTable,&endTableSDH); -+ if(!bRes) -+ { -+ // -+ // Disaster! the table structure in the piecetable is screwed. -+ // we're totally stuffed now. -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ } -+ UT_sint32 iCurInsertAt = iColInsertAt; -+ PT_DocPosition posEndTable = m_pDoc->getStruxPosition(endTableSDH); -+ bool bEnd = false; -+ UT_sint32 iCurLeft,iCurRight,iCurTop,iCurBot,iNewLeft,iNewRight; -+ UT_sint32 iPrevLeft,iPrevRight,iPrevTop,iPrevBot; -+ cellSDH = tableSDH; -+ bool bFirst = true; -+ PT_DocPosition iLastChangedPos = 0; -+ if(bBefore && iCurInsertAt > 0) -+ { -+ iCurInsertAt--; -+ } -+ while(!bEnd) -+ { -+ bRes = m_pDoc->getNextStruxOfType(cellSDH,PTX_SectionCell,&cellSDH); -+ if(!bRes) -+ { -+ bEnd = true; -+ break; -+ } -+ endCellSDH = m_pDoc->getEndCellStruxFromCellSDH(cellSDH); -+ posEndCell = m_pDoc->getStruxPosition(endCellSDH); -+ if(posEndCell+1 > posEndTable) -+ { -+ bEnd = true; -+ break; -+ } -+ if(posEndCell+1 == posEndTable) -+ { -+ bEnd = true; -+ } -+ posCell = m_pDoc->getStruxPosition(cellSDH); -+ getCellParams(posCell+1, &iCurLeft, &iCurRight,&iCurTop,&iCurBot); -+// -+// OK after inserting, we simply increment all left/right attaches greater -+// than the iCurInsertAt by the number of columns we insert. -+// Or if there are two cells on the row with -+// same left attach, increment the second one. -+// -+// -+ bool bChange = false; -+ iNewLeft = iCurLeft; -+ iNewRight = iCurRight; -+ if(!bFirst) -+ { -+ bRes = m_pDoc->getPrevStruxOfType(cellSDH,PTX_SectionCell,&prevCellSDH); -+ posPrevCell = m_pDoc->getStruxPosition(prevCellSDH); -+ getCellParams(posPrevCell+1, &iPrevLeft, &iPrevRight,&iPrevTop,&iPrevBot); -+ if(iPrevLeft == iCurLeft && (iPrevTop == iCurTop) && (iLastChangedPos != posCell)) -+ { -+ iLastChangedPos = posCell; -+ bChange = true; -+ iNewLeft+= 1; -+ iNewRight+= 1; -+ } -+ } -+ if(!bChange) -+ { -+ if((iCurLeft > iCurInsertAt +1) && (iLastChangedPos != posCell)) -+ { -+ iLastChangedPos = posCell; -+ bChange = true; -+ iNewLeft+=1; -+ iNewRight+=1; -+ } -+ } -+ UT_DEBUGMSG(("SEVIOR: Looking at cell left %d right %d top %d bot %d bChange %d \n",iCurLeft,iCurRight,iCurTop,iCurBot,bChange)); -+ if(bChange) -+ { -+ UT_DEBUGMSG(("SEVIOR: changing cell to left %d right %d top %d bot %d \n",iNewLeft,iNewRight,iCurTop,iCurBot)); -+ const char * props[9] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; -+ UT_String sLeft,sRight,sTop,sBot; -+ props[0] = "left-attach"; -+ UT_String_sprintf(sLeft,"%d",iNewLeft); -+ props[1] = sLeft.c_str(); -+ props[2] = "right-attach"; -+ UT_String_sprintf(sRight,"%d",iNewRight); -+ props[3] = sRight.c_str(); -+ props[4] = "top-attach"; -+ UT_String_sprintf(sTop,"%d",iCurTop); -+ props[5] = sTop.c_str(); -+ props[6] = "bot-attach"; -+ UT_String_sprintf(sBot,"%d",iCurBot); -+ props[7] = sBot.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Changing cell strux %s %s %s %s %s %s %s %s \n",props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7])); -+ bRes = m_pDoc->changeStruxFmt(PTC_AddFmt,posCell+1,posCell+1,NULL,props,PTX_SectionCell); -+ } -+ bFirst= false; -+ } -+// -+// End of multiple column insert. -+// -+ } -+// -+// Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+// with the restored line-type property it has before. -+// -+ iListTag += 1; -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+// -+// OK finish everything off with the various parameters which allow the formatter to -+// be updated. -+// -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+// Put the insertion point in a legal position -+// -+ setPoint(posFirstInsert); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+/*! -+ * posRow is the position of the start of the selection in the table. -+ * insert rows into the table. -+ */ -+bool FV_View::cmdInsertRow(PT_DocPosition posRow, bool bBefore) -+{ -+ PL_StruxDocHandle cellSDH,tableSDH,endTableSDH,endCellSDH; -+ PT_DocPosition posTable,posCell,posEndCell; -+ UT_sint32 numRowsForInsertion = getNumRowsInSelection(); -+ if(numRowsForInsertion == 0) -+ { -+ if(isSelectionEmpty() && isInTable(posRow)) -+ { -+ numRowsForInsertion = 1; -+ } -+ else -+ { -+ return false; -+ } -+ } -+ -+ if (!isSelectionEmpty()) -+ { -+ _clearSelection(); -+ } -+ -+ UT_sint32 iLeft,iRight,iTop,iBot; -+ getCellParams(posRow, &iLeft, &iRight,&iTop,&iBot); -+ -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(posRow,PTX_SectionCell,&cellSDH); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posRow,PTX_SectionTable,&tableSDH); -+ UT_return_val_if_fail(bRes, false); -+ -+ posTable = m_pDoc->getStruxPosition(tableSDH) + 1; -+ -+ // -+ // Now find the number of rows and columns inthis table. This is easiest to -+ // get from the table container -+ // -+ fl_BlockLayout * pBL = m_pLayout->findBlockAtPosition(posRow); -+ fp_Run * pRun; -+ UT_sint32 xPoint,yPoint,xPoint2,yPoint2,iPointHeight; -+ bool bDirection; -+ pRun = pBL->findPointCoords(posRow, false, xPoint, -+ yPoint, xPoint2, yPoint2, -+ iPointHeight, bDirection); -+ -+ UT_return_val_if_fail(pRun, false); -+ -+ fp_Line * pLine = pRun->getLine(); -+ UT_return_val_if_fail(pLine, false); -+ -+ fp_Container * pCon = pLine->getContainer(); -+ UT_return_val_if_fail(pCon, false); -+ -+ fp_TableContainer * pTab = static_cast(pCon->getContainer()); -+ UT_return_val_if_fail(pTab, false); -+ -+ UT_sint32 numCols = pTab->getNumCols(); -+ UT_sint32 numRows = pTab->getNumRows(); -+ -+ // -+ // Got all we need, now set things up to do the delete nicely -+ // -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ m_pDoc->setDontImmediatelyLayout(true); -+ -+ // -+ // Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+ // with a bogus line-type property. We'll restore it later. -+ // -+ const char * pszTable[3] = {NULL,NULL,NULL}; -+ pszTable[0] = "list-tag"; -+ const char * szListTag = NULL; -+ UT_String sListTag; -+ UT_sint32 iListTag; -+ m_pDoc->getPropertyFromSDH(tableSDH,isShowRevisions(),getRevisionLevel(),pszTable[0],&szListTag); -+ if(szListTag == NULL || *szListTag == '\0') -+ { -+ iListTag = 0; -+ } -+ else -+ { -+ iListTag = atoi(szListTag); -+ iListTag -= 1; -+ } -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG(("Sevior: Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+ -+ // -+ // OK find the position to insert the row. -+ // Have to handle the case of a cell spanning multiple rows. -+ // -+ // scan the piecetable and find either the first cell that has an attach above the current -+ // row (bBefore or the cell witht he largest bottom attach that has a top attach on the row -+ // for before -+ // -+ UT_sint32 prevTop = 100000; -+ if(bBefore) -+ { -+ UT_sint32 Left,Right,Top,Bot; -+ for(UT_sint32 i = 0; i < numCols; i++) -+ { -+ posCell = findCellPosAt(posTable,iTop,i); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posCell+1,PTX_SectionCell,&cellSDH); -+ getCellParams(posCell+1,&Left,&Right,&Top,&Bot); -+ UT_DEBUGMSG(("Sevior: Cell position left %d right %d top %d bot %d \n",Left,Right,Top,Bot)); -+ if(Top < prevTop) -+ { -+ prevTop = Top; -+ } -+ } -+// -+// We insert at this position -+// -+ posCell = findCellPosAt(posTable,prevTop,0); -+ } -+ else -+ { -+ UT_sint32 prevBot = -1; -+ for(UT_sint32 i = 0; i < numCols; i++) -+ { -+ posCell = findCellPosAt(posTable,iTop,i); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posCell+1,PTX_SectionCell,&cellSDH); -+ UT_sint32 Left,Right,Top,Bot; -+ getCellParams(posCell+1,&Left,&Right,&Top,&Bot); -+ UT_DEBUGMSG(("Sevior: Cell position left %d right %d top %d bot %d \n",Left,Right,Top,Bot)); -+ if(Bot > prevBot) -+ { -+ prevBot = Bot; -+ } -+ } -+// -+// We insert at poscell position -+// -+ if(prevBot > numRows -1) -+ { -+// -+// After Last row so just before the end of table -+// -+ prevTop = numRows; -+ endTableSDH = m_pDoc->getEndTableStruxFromTableSDH(tableSDH); -+ if(!endTableSDH) -+ { -+ // -+ // Disaster! the table structure in the piecetable is screwed. -+ // we're totally stuffed now. -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ } -+ posCell = m_pDoc->getStruxPosition(endTableSDH); -+ } -+ else -+ { -+ prevTop = prevBot; -+ posCell = findCellPosAt(posTable,prevBot,0); -+ } -+ UT_DEBUGMSG(("SEVIOR: Inserting after row %d \n",prevTop)); -+ } -+// -+// Got position and top row pos -+// Now insert a row. -+// -+ PT_DocPosition posInsert = 0; -+ UT_sint32 i =0; -+ UT_sint32 j = 0; -+ for(j=0; j< numRowsForInsertion; j++) -+ { -+ for(i=0; i < numCols; i++) -+ { -+ const gchar * props[9] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; -+ UT_String sRowTop = "top-attach"; -+ UT_String sRowBot = "bot-attach"; -+ UT_String sColLeft = "left-attach"; -+ UT_String sColRight = "right-attach"; -+ UT_String sTop,sBot,sLeft,sRight; -+ UT_String_sprintf(sTop,"%d",prevTop); -+ UT_String_sprintf(sBot,"%d",prevTop+1); -+ UT_String_sprintf(sLeft,"%d",i); -+ UT_String_sprintf(sRight,"%d",i+1); -+ props[0] = sRowTop.c_str(); -+ props[1] = sTop.c_str(); -+ props[2] = sRowBot.c_str(); -+ props[3] = sBot.c_str(); -+ props[4] = sColLeft.c_str(); -+ props[5] = sLeft.c_str(); -+ props[6] = sColRight.c_str(); -+ props[7] = sRight.c_str(); -+ bRes = m_pDoc->insertStrux(posCell,PTX_SectionCell,NULL,props); -+ bRes = m_pDoc->insertStrux(posCell+1,PTX_Block); -+ if(i == 0) -+ { -+ posInsert = posCell+2; -+ } -+ bRes = m_pDoc->insertStrux(posCell+2,PTX_EndCell); -+ posCell += 3; -+ } -+ prevTop++; -+ } -+// -+// OK! now starting immediately after this insert loop through the table adding 1 to top and bottom -+// -+ endTableSDH = m_pDoc->getEndTableStruxFromTableSDH(tableSDH); -+ if(!bRes) -+ { -+ // -+ // Disaster! the table structure in the piecetable is screwed. -+ // we're totally stuffed now. -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ } -+ PT_DocPosition posEndTable = m_pDoc->getStruxPosition(endTableSDH); -+ bool bEnd = false; -+ UT_sint32 iCurLeft,iCurRight,iCurTop,iCurBot; -+// -+// -2 gives the last cell inserted. -+// -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posCell-2,PTX_SectionCell,&cellSDH); -+ while(!bEnd) -+ { -+ bRes = m_pDoc->getNextStruxOfType(cellSDH,PTX_SectionCell,&cellSDH); -+ if(!bRes) -+ { -+ bEnd = true; -+ break; -+ } -+ endCellSDH = m_pDoc->getEndCellStruxFromCellSDH(cellSDH); -+ posEndCell = m_pDoc->getStruxPosition(endCellSDH); -+ if(posEndCell+1 > posEndTable) -+ { -+ bEnd = true; -+ break; -+ } -+ if(posEndCell+1 == posEndTable) -+ { -+ bEnd = true; -+ } -+ posCell = m_pDoc->getStruxPosition(cellSDH); -+ getCellParams(posCell+1, &iCurLeft, &iCurRight,&iCurTop,&iCurBot); -+ iCurTop+=numRowsForInsertion; -+ iCurBot+=numRowsForInsertion; -+ UT_DEBUGMSG(("SEVIOR: changing cell to left %d right %d top %d bot %d \n",iCurLeft,iCurRight,iCurTop,iCurBot)); -+ const char * props[9] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; -+ UT_String sLeft,sRight,sTop,sBot; -+ props[0] = "left-attach"; -+ UT_String_sprintf(sLeft,"%d",iCurLeft); -+ props[1] = sLeft.c_str(); -+ props[2] = "right-attach"; -+ UT_String_sprintf(sRight,"%d",iCurRight); -+ props[3] = sRight.c_str(); -+ props[4] = "top-attach"; -+ UT_String_sprintf(sTop,"%d",iCurTop); -+ props[5] = sTop.c_str(); -+ props[6] = "bot-attach"; -+ UT_String_sprintf(sBot,"%d",iCurBot); -+ props[7] = sBot.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Changing cell strux %s %s %s %s %s %s %s %s \n",props[0],props[1],props[2],props[3],props[4],props[5],props[6],props[7])); -+ bRes = m_pDoc->changeStruxFmt(PTC_AddFmt,posCell+1,posCell+1,NULL,props,PTX_SectionCell); -+ } -+ // -+ // Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+ // with the restored line-type property it has before. -+ // -+ iListTag += 1; -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+ -+ // -+ // OK finish everything off with the various parameters which allow the formatter to -+ // be updated. -+ // -+ setPoint(posInsert); -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+/*! -+ * Delete the column containing the position posCol -+ */ -+bool FV_View::cmdDeleteCol(PT_DocPosition posCol) -+{ -+ PL_StruxDocHandle cellSDH,tableSDH,endTableSDH,endCellSDH; -+ PT_DocPosition posTable,posCell; -+ UT_sint32 iLeft,iRight,iTop,iBot; -+ getCellParams(posCol, &iLeft, &iRight,&iTop,&iBot); -+ -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(posCol,PTX_SectionCell,&cellSDH); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posCol,PTX_SectionTable,&tableSDH); -+ UT_return_val_if_fail(bRes, false); -+ -+ posTable = m_pDoc->getStruxPosition(tableSDH) + 1; -+// -+// Now find the number of rows and columns inthis table. This is easiest to -+// get from the table container -+// -+ fl_BlockLayout * pBL = m_pLayout->findBlockAtPosition(posCol); -+ fp_Run * pRun; -+ UT_sint32 xPoint,yPoint,xPoint2,yPoint2,iPointHeight; -+ bool bDirection; -+ pRun = pBL->findPointCoords(posCol, false, xPoint, -+ yPoint, xPoint2, yPoint2, -+ iPointHeight, bDirection); -+ -+ UT_return_val_if_fail(pRun, false); -+ -+ fp_Line * pLine = pRun->getLine(); -+ UT_return_val_if_fail(pLine, false); -+ -+ fp_Container * pCon = pLine->getContainer(); -+ UT_return_val_if_fail(pCon, false); -+ -+ fp_TableContainer * pTab = static_cast(pCon->getContainer()); -+ UT_return_val_if_fail(pTab, false); -+ -+ UT_sint32 numRows = pTab->getNumRows(); -+// -+// If we delete the last column we're actually deleteing the table. So let's -+// do it. -+// -+ if(pTab->getNumCols() ==1) -+ { -+ cmdDeleteTable(posCol); -+ return true; -+ } -+// -+// Got all we need, now set things up to do the delete nicely -+// -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ if (!isSelectionEmpty() && !m_FrameEdit.isActive()) -+ { -+ m_pDoc->beginUserAtomicGlob(); -+ PP_AttrProp AttrProp_Before; -+ _deleteSelection(&AttrProp_Before); -+ m_pDoc->endUserAtomicGlob(); -+ } -+ else if(m_FrameEdit.isActive()) -+ { -+ m_FrameEdit.setPointInside(); -+ } -+ m_pDoc->setDontImmediatelyLayout(true); -+// -+// Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+// with a bogus line-type property. We'll restore it later. -+// -+ const char * pszTable[3] = {NULL,NULL,NULL}; -+ pszTable[0] = "list-tag"; -+ const char * szListTag = NULL; -+ UT_String sListTag; -+ UT_sint32 iListTag; -+ m_pDoc->getPropertyFromSDH(tableSDH,isShowRevisions(),getRevisionLevel(),pszTable[0],&szListTag); -+ if(szListTag == NULL || *szListTag == '\0') -+ { -+ iListTag = 0; -+ } -+ else -+ { -+ iListTag = atoi(szListTag); -+ iListTag -= 1; -+ } -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+// -+// OK loop through all the rows in this column and delete the entries in the specified -+// column if the cell spans just the width of the column.. -+// -+ UT_sint32 i =0; -+ for(i=0; i iLeft -+// do this by running through the linked list of SectionCell fragments in the piecetable -+// -+// We stop when the position of the endCell strux is just before the position of -+// the endTable strux. So lets's get that now. -+// -+ bRes = m_pDoc->getNextStruxOfType(tableSDH,PTX_EndTable,&endTableSDH); -+ if(!bRes) -+ { -+ // -+ // Disaster! the table structure in the piecetable is screwed. -+ // we're totally stuffed now. -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ } -+ PT_DocPosition posEndTable = m_pDoc->getStruxPosition(endTableSDH); -+ PT_DocPosition posEndCell; -+ bool bEnd = false; -+ UT_sint32 iCurLeft,iCurRight,iCurTop,iCurBot,iNewLeft,iNewRight; -+ cellSDH = tableSDH; -+ while(!bEnd) -+ { -+ bRes = m_pDoc->getNextStruxOfType(cellSDH,PTX_SectionCell,&cellSDH); -+ if(!bRes) -+ { -+ bEnd = true; -+ break; -+ } -+ posCell = m_pDoc->getStruxPosition(cellSDH); -+ getCellParams(posCell+1, &iCurLeft, &iCurRight,&iCurTop,&iCurBot); -+ UT_DEBUGMSG(("SEVIOR: Looking at cell left %d right %d top %d bot %d \n",iCurLeft,iCurRight,iCurTop,iCurBot)); -+ bool bChange = false; -+ iNewLeft = iCurLeft; -+ iNewRight = iCurRight; -+ if(iCurLeft > iLeft) -+ { -+ bChange = true; -+ iNewLeft--; -+ } -+ if(iCurRight > iLeft) -+ { -+ bChange = true; -+ iNewRight--; -+ } -+ if(bChange) -+ { -+ UT_DEBUGMSG(("SEVIOR: changing cell to left %d right %d top %d bot %d \n",iNewLeft,iNewRight,iCurTop,iCurBot)); -+ const char * props[9] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; -+ UT_String sLeft,sRight,sTop,sBot; -+ props[0] = "left-attach"; -+ UT_String_sprintf(sLeft,"%d",iNewLeft); -+ props[1] = sLeft.c_str(); -+ props[2] = "right-attach"; -+ UT_String_sprintf(sRight,"%d",iNewRight); -+ props[3] = sRight.c_str(); -+ props[4] = "top-attach"; -+ UT_String_sprintf(sTop,"%d",iCurTop); -+ props[5] = sTop.c_str(); -+ props[6] = "bot-attach"; -+ UT_String_sprintf(sBot,"%d",iCurBot); -+ props[7] = sBot.c_str(); -+ bRes = m_pDoc->changeStruxFmt(PTC_AddFmt,posCell+1,posCell+1,NULL,props,PTX_SectionCell); -+ } -+ endCellSDH = m_pDoc->getEndCellStruxFromCellSDH(cellSDH); -+ posEndCell = m_pDoc->getStruxPosition(endCellSDH); -+ if(posEndCell+1 >= posEndTable) -+ { -+ bEnd = true; -+ } -+ } -+// -+// Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+// with the restored line-type property it has before. -+// -+ iListTag += 1; -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+// -+// OK finish everything off with the various parameters which allow the formatter to -+// be updated. -+// -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _fixInsertionPointCoords(); -+ -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+ -+/*! -+ * Delete the table containing the position posRow -+ */ -+bool FV_View::cmdDeleteTable(PT_DocPosition posTable, bool bDontNotify) -+{ -+ PL_StruxDocHandle tableSDH,endTableSDH; -+ PT_DocPosition posStartTable,posEndTable; -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(posTable,PTX_SectionTable,&tableSDH); -+ if(!bRes) -+ { -+ return false; -+ } -+ posStartTable = m_pDoc->getStruxPosition(tableSDH); -+ endTableSDH = m_pDoc->getEndTableStruxFromTableSDH(tableSDH); -+ posEndTable = m_pDoc->getStruxPosition(endTableSDH)+1; -+// -+// Got all we need, now set things up to do the delete nicely -+// -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ if (!isSelectionEmpty()) -+ { -+ _clearSelection(); -+ _resetSelection(); -+ } -+ m_pDoc->setDontImmediatelyLayout(true); -+// -+// OK do the delete -+// -+ UT_uint32 iRealDeleteCount; -+ // if(m_pDoc->isFrameAtPos(posStartTable-1)) -+ // posStartTable--; -+ m_pDoc->deleteSpan( posStartTable, posEndTable, NULL,iRealDeleteCount,true); -+// -+// OK finish everything off with the various parameters which allow the formatter to -+// be updated. -+// -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ setPoint(getPoint()); -+ // -+ // This method could be called from text to tablein which case -+ // we don't want to do this. -+ // -+ if(!bDontNotify) -+ { -+ notifyListeners(AV_CHG_ALL); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ } -+ return true; -+} -+ -+/*! -+ * Delete the row containing the position posRow -+ */ -+bool FV_View::cmdDeleteRow(PT_DocPosition posRow) -+{ -+ PL_StruxDocHandle cellSDH,tableSDH,endTableSDH,endCellSDH; -+ PT_DocPosition posTable,posCell; -+ UT_sint32 iLeft,iRight,iTop,iBot; -+ getCellParams(posRow, &iLeft, &iRight,&iTop,&iBot); -+ -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(posRow,PTX_SectionCell,&cellSDH); -+ bRes = m_pDoc->getStruxOfTypeFromPosition(posRow,PTX_SectionTable,&tableSDH); -+ UT_return_val_if_fail(bRes, false); -+ -+ posTable = m_pDoc->getStruxPosition(tableSDH) + 1; -+// -+// Now find the number of rows and columns inthis table. This is easiest to -+// get from the table container -+// -+ fl_TableLayout * pTabL = getTableAtPos(posRow); -+ if(pTabL == NULL) -+ { -+ pTabL = getTableAtPos(posRow+1); -+ if(pTabL == NULL) -+ { -+ pTabL = getTableAtPos(posRow+2); -+ UT_return_val_if_fail(pTabL, false); -+ } -+ } -+ fp_TableContainer * pTab = static_cast(pTabL->getFirstContainer()); -+ UT_return_val_if_fail(pTab, false); -+ UT_sint32 numCols = pTab->getNumCols(); -+// -+// If we delete the last row we're actually deleting the table, so do that -+// instead. -+// -+ UT_sint32 nRows = getNumRowsInSelection(); -+ if(pTab->getNumRows() == 1 || (nRows == pTab->getNumRows())) -+ { -+ cmdDeleteTable(posRow); -+ return true; -+ } -+// -+// Got all we need, now set things up to do the delete nicely -+// -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ UT_sint32 numRows = getNumRowsInSelection(); -+ if (!isSelectionEmpty() && !m_FrameEdit.isActive()) -+ { -+ m_pDoc->beginUserAtomicGlob(); -+ PP_AttrProp AttrProp_Before; -+ _deleteSelection(&AttrProp_Before); -+ m_pDoc->endUserAtomicGlob(); -+ } -+ else if(m_FrameEdit.isActive()) -+ { -+ m_FrameEdit.setPointInside(); -+ } -+ m_pDoc->setDontImmediatelyLayout(true); -+// -+// Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+// with a bogus line-type property. We'll restore it later. -+// -+ const char * pszTable[3] = {NULL,NULL,NULL}; -+ pszTable[0] = "list-tag"; -+ const char * szListTag = NULL; -+ UT_String sListTag; -+ UT_sint32 iListTag; -+ m_pDoc->getPropertyFromSDH(tableSDH,isShowRevisions(),getRevisionLevel(),pszTable[0],&szListTag); -+ if(szListTag == NULL || *szListTag == '\0') -+ { -+ iListTag = 0; -+ } -+ else -+ { -+ iListTag = atoi(szListTag); -+ iListTag -= 1; -+ } -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+// -+// OK loop through all the rows in this column and delete the entries in the specified -+// column if the cell spans just the width of the column.. -+// -+ UT_sint32 i =0; -+ UT_sint32 j = 0; -+ for(j=numRows-1; j>=0; j--) -+ { -+ for(i=numCols-1; i >=0; i--) -+ { -+ PT_DocPosition posCell = findCellPosAt(posTable,iTop+j,i); -+ UT_sint32 Left,Right,Top,Bot; -+ getCellParams(posCell+1,&Left,&Right,&Top,&Bot); -+ UT_DEBUGMSG(("SEVIOR: Before delete left %d right %d top %d bot %d \n",Left,Right,Top,Bot)); -+ if((Bot - Top) == 1) -+ { -+ _deleteCellAt(posTable,iTop+j, i); -+ } -+ } -+ } -+// -+// OK now subtract numRows from all the row coordinates in the table with iTop,iBot > iTop -+// do this by running through the linked list of SectionCell fragments in the piecetable -+// -+// We stop when the position of the endCell strux is just before the position of -+// the endTable strux. So lets's get that now. -+// -+ endTableSDH = m_pDoc->getEndTableStruxFromTableSDH(tableSDH); -+ if(!bRes || (endTableSDH == NULL)) -+ { -+ // -+ // Disaster! the table structure in the piecetable is screwed. -+ // we're totally stuffed now. -+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN); -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ m_pDoc->endUserAtomicGlob(); -+ return false;; -+ } -+ PT_DocPosition posEndTable = m_pDoc->getStruxPosition(endTableSDH); -+ PT_DocPosition posEndCell; -+ bool bEnd = false; -+ UT_sint32 iCurLeft,iCurRight,iCurTop,iCurBot,iNewTop,iNewBot; -+ cellSDH = tableSDH; -+ while(!bEnd) -+ { -+ bRes = m_pDoc->getNextStruxOfType(cellSDH,PTX_SectionCell,&cellSDH); -+ if(!bRes) -+ { -+ bEnd = true; -+ break; -+ } -+ posCell = m_pDoc->getStruxPosition(cellSDH); -+ getCellParams(posCell+1, &iCurLeft, &iCurRight,&iCurTop,&iCurBot); -+ UT_DEBUGMSG(("SEVIOR: Looking at cell left %d right %d top %d bot %d \n",iCurLeft,iCurRight,iCurTop,iCurBot)); -+ bool bChange = false; -+ iNewTop = iCurTop; -+ iNewBot = iCurBot; -+ if(iCurTop > iTop) -+ { -+ bChange = true; -+ iNewTop -= numRows; -+ } -+ if(iCurBot > iTop) -+ { -+ bChange = true; -+ iNewBot -= numRows; -+ } -+ if(bChange) -+ { -+ UT_DEBUGMSG(("SEVIOR: changing cell to left %d right %d top %d bot %d \n",iCurLeft,iCurRight,iNewTop,iNewBot)); -+ const char * props[9] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; -+ UT_String sLeft,sRight,sTop,sBot; -+ props[0] = "left-attach"; -+ UT_String_sprintf(sLeft,"%d",iCurLeft); -+ props[1] = sLeft.c_str(); -+ props[2] = "right-attach"; -+ UT_String_sprintf(sRight,"%d",iCurRight); -+ props[3] = sRight.c_str(); -+ props[4] = "top-attach"; -+ UT_String_sprintf(sTop,"%d",iNewTop); -+ props[5] = sTop.c_str(); -+ props[6] = "bot-attach"; -+ UT_String_sprintf(sBot,"%d",iNewBot); -+ props[7] = sBot.c_str(); -+ bRes = m_pDoc->changeStruxFmt(PTC_AddFmt,posCell+1,posCell+1,NULL,props,PTX_SectionCell); -+ } -+ endCellSDH = m_pDoc->getEndCellStruxFromCellSDH(cellSDH); -+ posEndCell = m_pDoc->getStruxPosition(endCellSDH); -+ if(posEndCell+1 >= posEndTable) -+ { -+ bEnd = true; -+ } -+ } -+// -+// Now trigger a rebuild of the whole table by sending a changeStrux to the table strux -+// with the restored line-type property it has before. -+// -+ iListTag += 1; -+ UT_String_sprintf(sListTag,"%d",iListTag); -+ pszTable[1] = sListTag.c_str(); -+ UT_DEBUGMSG(("SEVIOR: Doing Table strux change of %s %s \n",pszTable[0],pszTable[1])); -+ m_pDoc->changeStruxFmt(PTC_AddFmt,posTable,posTable,NULL,pszTable,PTX_SectionTable); -+// -+// OK finish everything off with the various parameters which allow the formatter to -+// be updated. -+// -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _fixInsertionPointCoords(); -+ -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+} -+ -+ -+/*! -+ * Delete the cell at the specified position -+ */ -+bool FV_View::cmdDeleteCell(PT_DocPosition cellPos) -+{ -+#if 1 -+ UT_ASSERT(UT_NOT_IMPLEMENTED); -+ return true ; -+#else -+ PL_StruxDocHandle cellSDH; -+ const char * pszLeftAttach =NULL; -+ const char * pszTopAttach = NULL; -+ UT_sint32 iLeft =-999; -+ UT_sint32 iTop = -999; -+ bool bRes = m_pDoc->getStruxOfTypeFromPosition(cellPos,PTX_SectionCell,&cellSDH); -+ if(!bRes) -+ { -+ return false; -+ } -+ m_pDoc->getPropertyFromSDH(cellSDH,"left-attach",&pszLeftAttach); -+ m_pDoc->getPropertyFromSDH(cellSDH,"top-attach",&pszTopAttach); -+ if(pszLeftAttach && *pszLeftAttach) -+ { -+ iLeft = atoi(pszLeftAttach); -+ } -+ if(pszTopAttach && *pszTopAttach) -+ { -+ iTop = atoi(pszTopAttach); -+ } -+// -+// Got all we need, now set things up to do the delete nicely -+// -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ if (!isSelectionEmpty() && !m_FrameEdit.isActive()) -+ { -+ m_pDoc->beginUserAtomicGlob(); -+ PP_AttrProp AttrProp_Before; -+ _deleteSelection(&AttrProp_Before); -+ m_pDoc->endUserAtomicGlob(); -+ } -+ else if(m_FrameEdit.isActive()) -+ { -+ m_FrameEdit.setPointInside(); -+ } -+ m_pDoc->setDontImmediatelyLayout(true); -+// -+// delete the cell. -+// -+ _deleteCellAt(cellPos,iTop, iLeft); -+// -+// OK do all the piecetable finished changing business -+// -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _fixInsertionPointCoords(); -+ -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION); -+ return true; -+#endif -+} -+ -+ -+/*! -+ * Insert a table of the number of rows and columns given. -+ */ -+UT_Error FV_View::cmdInsertTable(UT_sint32 numRows, UT_sint32 numCols, const gchar * pPropsArray[]) -+{ -+ // TODO -- why does this function return UT_Error? If bool is -+ // sufficient, it should return bool, and if not, than the -+ // UT_Error & bool operations below are probably not safe -+ UT_Error e = UT_OK; -+ if(numRows == 0 || numCols==0) -+ { -+ return 0; -+ } -+ if(isInTable(getPoint()-1) && isInTable() && isHdrFtrEdit()) -+ { -+ return 0; -+ } -+ if(isInTable(getPoint()) && !isSelectionEmpty() && isHdrFtrEdit()) -+ { -+ return 0; -+ } -+ -+// -+// Do all the stuff we need to make this go smoothly and to undo in a single step. -+// -+ // Signal PieceTable Changes -+ _saveAndNotifyPieceTableChange(); -+ -+ // Turn off list updates -+ -+ m_pDoc->disableListUpdates(); -+ m_pDoc->beginUserAtomicGlob(); -+ if (!isSelectionEmpty() && !m_FrameEdit.isActive()) -+ { -+ m_pDoc->setDontImmediatelyLayout(true); -+ m_pDoc->beginUserAtomicGlob(); -+ PP_AttrProp AttrProp_Before; -+ _deleteSelection(&AttrProp_Before); -+ m_pDoc->endUserAtomicGlob(); -+ } -+ else if(m_FrameEdit.isActive()) -+ { -+ m_FrameEdit.setPointInside(); -+ } -+ else -+ { -+ m_pDoc->setDontImmediatelyLayout(true); -+ } -+ if(getHyperLinkRun(getPoint()) != NULL) -+ { -+ -+ // Signal PieceTable Changes have finished -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _restorePieceTableState(); -+ return 0; -+ } -+// -+// Handle corner case of point at endTOC -+// -+ if(m_pDoc->isTOCAtPos(getPoint()-1)) -+ { -+ setPoint(getPoint()-1); -+ } -+// -+// insert a block to terminate the text before this. -+// -+ PT_DocPosition pointBreak = getPoint(); -+ PT_DocPosition pointTable = 0; -+ // -+ // Don't do this if there is a block at pointBreak already. -+ // -+ bool bInsert = false; -+ if((!m_pDoc->isBlockAtPos(getPoint()) && !m_pDoc->isTableAtPos(getPoint()) && !(m_pDoc->isEndFrameAtPos(getPoint()) && m_pDoc->isBlockAtPos(getPoint()-1) )) || m_pDoc->isTOCAtPos(getPoint()-2) ) -+ { -+ e = m_pDoc->insertStrux(getPoint(),PTX_Block); -+ bInsert = true; -+ } -+ bool bPointBreak = false; -+ if(!bInsert && !m_pDoc->isTableAtPos(getPoint()) && !m_pDoc->isEndFootnoteAtPos(getPoint()-2) && !m_pDoc->isEndFootnoteAtPos(getPoint()-1) && !m_pDoc->isBlockAtPos(getPoint())) -+ { -+ pointBreak--; -+ bPointBreak = true; -+ } -+ if(!bPointBreak && m_pDoc->isBlockAtPos(getPoint())) -+ { -+ PT_DocPosition posEnd = 0; -+ getEditableBounds(true,posEnd); -+ if((posEnd == getPoint())) -+ { -+ pointBreak--; -+ bPointBreak = true; -+ } -+ else if(m_pDoc->isSectionAtPos(getPoint()-1) || m_pDoc->isEndTableAtPos(getPoint()-1) || m_pDoc->isEndFrameAtPos(getPoint() - 1)) -+ { -+ pointBreak--; -+ bPointBreak = true; -+ } -+ else if(m_pDoc->isSectionAtPos(getPoint()-2)) -+ { -+ pointBreak--; -+ bPointBreak = true; -+ } -+ if(m_pDoc->isEndFootnoteAtPos(pointBreak)) -+ { -+ pointBreak++; -+ bPointBreak = false; -+ } -+ if(bPointBreak && !m_pDoc->isBlockAtPos(pointBreak)) -+ { -+ pointBreak++; -+ bPointBreak = false; -+ } -+ -+ } -+// -+// Insert the table strux at the same spot. This will make the table link correctly in the -+// middle of the broken text. -+// -+// Handle special case of not putting a table immediately after a section break -+// -+ PL_StruxDocHandle secSDH = NULL; -+ bool bres = m_pDoc->getStruxOfTypeFromPosition(pointBreak-1,PTX_Section,&secSDH); -+ PT_DocPosition secPos = m_pDoc->getStruxPosition(secSDH); -+ UT_DEBUGMSG(("SEVIOR: SecPos %d pointBreak %d \n",secPos,pointBreak)); -+ secSDH = NULL; -+ bres = m_pDoc->getStruxOfTypeFromPosition(pointBreak,PTX_SectionCell,&secSDH); -+ if(secSDH != NULL) -+ { -+ PT_DocPosition secPos = m_pDoc->getStruxPosition(secSDH); -+ UT_DEBUGMSG(("SEVIOR: Cell Pos %d pointBreak %d \n",secPos,pointBreak)); } -+// -+// Handle special case of not putting a table immediately after an end text box -+// -+ if(m_pDoc->isEndFrameAtPos(pointBreak-1)) -+ { -+ pointBreak--; -+ } -+ // -+ // Handle special case of not putting a table in a TOC -+ // -+ if(m_pDoc->isTOCAtPos(pointBreak-1)) -+ { -+ pointBreak++; -+ } -+ -+ setPoint(pointBreak); -+ e |= static_cast(m_pDoc->insertStrux(getPoint(),PTX_SectionTable,NULL,pPropsArray)); -+// -+// stuff for cell insertion. -+// -+ UT_sint32 i,j; -+ const gchar * attrs[3] = {"style","Normal",NULL}; -+ const gchar * props[9] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; -+ UT_String sRowTop = "top-attach"; -+ UT_String sRowBot = "bot-attach"; -+ UT_String sColLeft = "left-attach"; -+ UT_String sColRight = "right-attach"; -+ UT_String sTop,sBot,sLeft,sRight; -+ for(i=0;i(m_pDoc->insertStrux(getPoint(),PTX_SectionCell,NULL,props)); -+ pointBreak = getPoint(); -+ e |= static_cast(m_pDoc->insertStrux(getPoint(),PTX_Block,attrs,NULL)); -+ UT_DEBUGMSG(("SEVIOR: 4 cur point %d \n",getPoint())); -+ if(getPoint() == pointBreak) -+ { -+ setPoint(pointBreak+1); -+ } -+ if(i == 0 && j==0) -+ { -+ pointTable = getPoint(); -+ } -+ e |= static_cast(m_pDoc->insertStrux(getPoint(),PTX_EndCell)); -+ } -+ } -+ e |= static_cast(m_pDoc->insertStrux(getPoint(),PTX_EndTable)); -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ -+ m_pDoc->endUserAtomicGlob(); -+ setPoint(pointTable); -+ _fixInsertionPointCoords(); -+ m_pG->getCaret()->setBlink(false); -+ focusChange(AV_FOCUS_HERE); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ AV_View::notifyListeners (AV_CHG_ALL); -+ return e; -+} -+ -+bool FV_View::cmdCharInsert(const UT_UCSChar * text, UT_uint32 count, bool bForce) -+{ -+ // -+ // Look if we should insert a pargraph before the table -+ // -+ if(m_bInsertAtTablePending && (count==1) && (text[0] != UCS_FF) && (text[0] != UCS_VTAB)) -+ { -+ -+ m_pDoc->beginUserAtomicGlob(); -+ -+ // Prevent access to Piecetable for things like spellchecks until -+ // paragraphs have stablized -+ // -+ _saveAndNotifyPieceTableChange(); -+ m_pDoc->disableListUpdates(); -+ PT_DocPosition pos = m_iPosAtTable; -+ m_pDoc->insertStrux( m_iPosAtTable,PTX_Block); -+ m_bInsertAtTablePending = false; -+ -+ // Signal piceTable is stable again -+ _restorePieceTableState(); -+ -+ // Signal piceTable is stable again -+ // Signal PieceTable Changes have finished -+ _generalUpdate(); -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ setPoint(pos+1); -+ m_iPosAtTable = 0; -+ _generalUpdate(); -+ bool res = _charInsert(text, count, bForce); -+ m_pDoc->endUserAtomicGlob(); -+ return res; -+ } -+ // the code below inserts a direction marker before a space if the automatic insertion of such -+ // markers is indicated by user's preferences and if the current keyboard language direction is -+ // inconsistent with the dominant direction of the paragraph (this makes phone numbers and similar -+ // to work in rtl languages more intuitively) -+ -+ // we only do this for space ... (certain other chars can be handled in ap_EditMethods.cpp -+ // because they do not need knowledge of block direction) -+ fl_BlockLayout * pBlock = NULL; -+ if(count == 1 && text[0] == UCS_SPACE) -+ { -+ bool bLang = false, bMarker = false; -+ -+ XAP_App::getApp()->getPrefsValueBool(static_cast(XAP_PREF_KEY_ChangeLanguageWithKeyboard), -+ &bLang); -+ -+ const UT_LangRecord * pLR = NULL; -+ -+ if(bLang) -+ { -+ pLR = XAP_App::getApp()->getKbdLanguage(); -+ -+ XAP_App::getApp()->getPrefsValueBool(static_cast(XAP_PREF_KEY_DirMarkerAfterClosingParenthesis), &bMarker); -+ } -+ -+ if(bMarker && pLR) -+ { -+ pBlock = m_pLayout->findBlockAtPosition(getPoint()); -+ -+ if(!pBlock) -+ goto normal_insert; -+ -+ { -+ UT_BidiCharType iDomDir = pBlock->getDominantDirection(); -+ -+ UT_UCS4Char data[2]; -+ data[1] = *text; -+ -+ if(pLR->m_eDir == UTLANG_RTL && iDomDir != UT_BIDI_RTL) -+ { -+ data[0] = UCS_RLM; -+ } -+ else if(pLR->m_eDir == UTLANG_LTR && iDomDir != UT_BIDI_LTR) -+ { -+ data[0] = UCS_LRM; -+ } -+ else -+ { -+ goto normal_insert; -+ } -+ -+ return _charInsert(&data[0],2,bForce); -+ } -+ } -+ } -+ else if(count == 1 && text[0] == UCS_FF) -+ { -+ m_pDoc->beginUserAtomicGlob(); -+ bool b = _charInsert(text, count, bForce); -+ if(b) -+ { -+ insertParagraphBreak(); -+ } -+ m_pDoc->endUserAtomicGlob(); -+ return b; -+ } -+ else if(count == 1 && text[0] == UCS_VTAB) -+ { -+ m_pDoc->beginUserAtomicGlob(); -+ bool b = _charInsert(text, count, bForce); -+ if(b) -+ { -+ insertParagraphBreak(); -+ } -+ m_pDoc->endUserAtomicGlob(); -+ return b; -+ } -+ normal_insert: -+ return _charInsert(text, count, bForce); -+} -+ -+bool FV_View::cmdStartList(const gchar * style) -+{ -+ m_pDoc->beginUserAtomicGlob(); -+ fl_BlockLayout * pBlock = getCurrentBlock(); -+ pBlock->StartList( style); -+ m_pDoc->endUserAtomicGlob(); -+ -+ return true; -+} -+ -+ -+bool FV_View::cmdStopList(void) -+{ -+ -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ m_pDoc->beginUserAtomicGlob(); -+ fl_BlockLayout * pBlock = getCurrentBlock(); -+ m_pDoc->StopList(pBlock->getStruxDocHandle()); -+ m_pDoc->endUserAtomicGlob(); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ return true; -+} -+ -+ -+void FV_View::cmdCharDelete(bool bForward, UT_uint32 count) -+{ -+ const gchar * properties[] = { "font-family", NULL, 0}; -+ const gchar ** props_in = NULL; -+ const gchar * currentfont; -+ bool bisList = false; -+ fl_BlockLayout * curBlock = NULL; -+ fl_BlockLayout * nBlock = NULL; -+ UT_uint32 iRealDeleteCount = 0; -+ -+ -+ if (!isSelectionEmpty() && !m_FrameEdit.isActive()) -+ { -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ m_pDoc->disableListUpdates(); -+ -+ _deleteSelection(); -+ _generalUpdate(); -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ } -+ else if(m_FrameEdit.isActive()) -+ { -+ deleteFrame(); -+ } -+ else -+ { -+ // -+ // Look to see if there is a tab - list label deal with these together -+ // -+ if((bForward == false) && (count == 1)) -+ { -+ UT_sint32 myCount= 0; -+ if(isTabListBehindPoint(myCount) == true) -+ { -+ curBlock = _findBlockAtPosition(getPoint()); -+ nBlock = _findBlockAtPosition(getPoint()-myCount); -+ if(nBlock == curBlock) -+ { -+ count = myCount; -+ bisList = true; -+ } -+ } -+ } -+ if((bForward == true) && (count == 1)) -+ { -+ if(isTabListAheadPoint() == true) -+ { -+// -+// Check we're at the start of a block -+// -+ if(getPoint() == getCurrentBlock()->getPosition()) -+ { -+ bisList = true; -+ count = 2; -+ } -+ } -+ -+ } -+// -+// Code to deal with deleting a footnote reference that embeds a footnote Layout. -+// -+ if(bForward) -+ { -+ if(!isInFootnote() && isInFootnote(getPoint() + count)) -+ { -+ fl_FootnoteLayout * pFL = getClosestFootnote(getPoint() + count +1); -+ count += pFL->getLength(); -+ } -+ if(!isInEndnote() && isInEndnote(getPoint() + count)) -+ { -+ fl_EndnoteLayout * pEL = getClosestEndnote(getPoint() + count +1); -+ count += pEL->getLength(); -+ } -+ if(m_pDoc->isTOCAtPos(getPoint())) -+ { -+ if(m_pDoc->isTOCAtPos(getPoint()-1)) -+ { -+ m_iInsPoint--; -+ } -+ count++; -+ -+ } -+ } -+ else -+ { -+ if(!isInFootnote(getPoint()) && isInFootnote(getPoint() - count)) -+ { -+ fl_FootnoteLayout * pFL = getClosestFootnote(getPoint()); -+ count += pFL->getLength(); -+ } -+ else if(isInFootnote(getPoint())) -+ { -+ if(!isInFootnote(getPoint() - count)) -+ { -+ return; -+ } -+ else if(!isInFootnote(getPoint() -2)) -+ { -+// -+// Don't delete the paragraph strux in footnote -+// -+ return; -+ } -+ else if(!isInFootnote(getPoint() -3)) -+ { -+// -+// Don't delete the paragraph strux in footnote -+// -+ return; -+ } -+ } -+ else if(!isInEndnote() && isInEndnote(getPoint() - count)) -+ { -+ fl_EndnoteLayout * pEL = getClosestEndnote(getPoint()); -+ count += pEL->getLength(); -+ } -+ else if(isInEndnote(getPoint())) -+ { -+ if(!isInEndnote(getPoint() - count)) -+ { -+ return; -+ } -+ else if(!isInEndnote(getPoint() -2)) -+ { -+// -+// Don't delete the paragraph strux in endnote -+// -+ return; -+ } -+ else if(!isInEndnote(getPoint() -3)) -+ { -+// -+// Don't delete the paragraph strux in endnote -+// -+ return; -+ } -+ -+ } -+ if(m_pDoc->isTOCAtPos(getPoint()-2)) -+ { -+ count +=2; -+ } -+ } -+ -+ // Code that deals with deleting runs that do not like to be deleted ... This handles runs -+ // that return true for deleteFollowingIfAtInsPoint(). Runs in this category are typically -+ // not visible on screen, such as hyperlinks and bookmarks, and are deleted through the main -+ // menu. Such runs must not be deleted inadvertedly when pressing delete/backpace. Just to -+ // exaplain why: for example, in Word bookmarks inadvertedly disappear when the bookmarked -+ // text is edited; this is extremely annoying if such bookmarks are referenced from page -+ // reference and similar fields, particularly if the document is long and contains many such -+ // fields -- imagine printing a 200+ page document, only to discover that on page 178 you -+ // have 'error: bookmark not found' where a page number should have been -- we want to -+ // minimise this happening and will only delete such runs when (a) the user explicitely asks -+ // to, or (b) they are inside a selection. -+ if(!curBlock) -+ curBlock = _findBlockAtPosition(getPoint()); -+ -+ if(bForward && count == 1) -+ { -+ UT_return_if_fail( curBlock ); -+ -+ fp_Run * pRun = curBlock->findRunAtOffset(getPoint() - curBlock->getPosition()); -+ -+ UT_return_if_fail( pRun ); -+ -+ fp_Run * pPrevRun = NULL; -+ UT_uint32 iLength = 0; -+ while(pRun && (pRun->deleteFollowingIfAtInsPoint() && (getPoint() == curBlock->getPosition() + pRun->getBlockOffset()))) -+ { -+ pPrevRun = pRun; -+ iLength += pRun->getLength(); -+ pRun = pRun->getNextRun(); -+ } -+ -+ _setPoint(m_iInsPoint + iLength); -+ -+ } -+ else if(!bForward && count == 1) -+ { -+ UT_return_if_fail( curBlock ); -+ -+ fp_Run * pRun = curBlock->findRunAtOffset(getPoint() - curBlock->getPosition()); -+ -+ UT_return_if_fail( pRun ); -+ -+ // back one further -+ pRun = pRun->getPrevRun(); -+ -+ fp_Run * pPrevRun = NULL; -+ UT_uint32 iLength = 0; -+ while(pRun && (pRun->deleteFollowingIfAtInsPoint() && (getPoint() == curBlock->getPosition() + pRun->getBlockOffset())) ) -+ { -+ pPrevRun = pRun; -+ iLength += pRun->getLength(); -+ pRun = pRun->getPrevRun(); -+ } -+ -+ _setPoint(m_iInsPoint - iLength); -+ -+ } -+ -+ // deal with character clusters, such as base char + vowel + tone mark in Thai -+ UT_uint32 pos1 = getPoint(); -+ if(!bForward) -+ { -+ UT_ASSERT_HARMLESS( pos1 > count ); -+ pos1 -= count; -+ } -+ -+ _adjustDeletePosition(pos1, count); -+ -+ if(bForward) -+ _setPoint(pos1); -+ else -+ _setPoint(pos1 + count); -+ -+ -+ // Code to deal with font boundary problem. -+ // TODO: This should really be fixed by someone who understands -+ // how this code works! In the meantime save current font to be -+ // restored after character is deleted. -+ -+ getCharFormat(&props_in); -+ currentfont = UT_getAttribute("font-family",props_in); -+ properties[1] = currentfont; -+ xxx_UT_DEBUGMSG(("deleteSpan - 1: Inital pos %d count %d \n",getPoint(),count)); -+ -+ UT_uint32 amt = count; -+ UT_uint32 posCur = getPoint(); -+ UT_uint32 nposCur = getPoint(); -+ bool fontFlag = false; -+ -+ if (!bForward) -+ { -+ -+ if (!_charMotion(bForward,count, false)) -+ { -+ UT_ASSERT(getPoint() <= posCur); -+ xxx_UT_DEBUGMSG(("SEVIOR: posCur %d getPoint() %d \n",posCur,getPoint())); -+ amt = posCur - getPoint(); -+ } -+ -+ posCur = getPoint(); -+ // Code to deal with change of font boundaries: -+ if((posCur == nposCur) && (posCur > 0)) -+ { -+ fontFlag = true; -+ posCur--; -+ } -+ } -+ else -+ { -+ PT_DocPosition posEOD; -+ bool bRes; -+ -+ bRes = getEditableBounds(true, posEOD); -+ UT_ASSERT(bRes); -+ UT_ASSERT(posCur <= posEOD); -+ -+ if (posEOD < (posCur+amt)) -+ { -+ amt = posEOD - posCur; -+ } -+ } -+ -+ if(!curBlock) -+ curBlock = _findBlockAtPosition(getPoint()); -+ -+// -+// Code to check for a delete over a frame boundary. -+// -+ if(isInFrame(posCur) && !isInFrame(posCur+amt)) -+ { -+ fl_FrameLayout * pFL = getFrameLayout(posCur+amt); -+ if(pFL != NULL) -+ { -+ // -+ // Delete to edge of text box -+ // -+ PT_DocPosition posFrame = pFL->getPosition(true); -+ amt = posFrame + pFL->getLength() - posCur; -+ } -+ return; -+ } -+ if(!isInFrame(posCur) && isInFrame(posCur+amt) && (amt > 1)) -+ { -+ fl_FrameLayout * pFL = getFrameLayout(posCur+amt); -+ if(pFL != NULL) -+ { -+ // -+ // delete to start of text box -+ // -+ PT_DocPosition posFrame = pFL->getPosition(true); -+ amt = posCur + amt + 1 - posFrame; -+ } -+ } -+// -+// isInFrame will return true if we're right at the frame strux or right -+// at the EndFrame strux. If we delete either we're screwed. Handle -+// the cases. -+// -+// Later we want to be clever about moving the frame into a valid position -+// in the new merged block. Just fix the crash for now. -+// -+ if(m_pDoc->isFrameAtPos(posCur) && isInFrame(posCur+amt) ) -+ { -+ return; -+ } -+ -+ if(m_pDoc->isEndFrameAtPos(posCur)) -+ { -+ return; -+ } -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ if (amt > 0) -+ { -+ m_pDoc->disableListUpdates(); -+ -+ nBlock = _findBlockAtPosition(getPoint()); -+ fl_AutoNum * pAuto = nBlock->getAutoNum(); -+ if(pAuto != NULL ) -+ { -+ PL_StruxDocHandle sdh = nBlock->getStruxDocHandle(); -+ if((bisList == true) && (pAuto->getFirstItem() == sdh || pAuto->getLastItem() == sdh)) -+ { -+ m_pDoc->StopList(sdh); -+ PT_DocPosition listPoint,posEOD; -+ getEditableBounds(true, posEOD); -+ listPoint = getPoint(); -+ fl_AutoNum * pAuto = nBlock->getAutoNum(); -+ if(pAuto != NULL) -+ { -+ if(listPoint + 2 <= posEOD) -+ _setPoint(listPoint+2); -+ else -+ _setPoint(posEOD); -+ } -+ } -+ else if(bisList == true) -+ { -+ -+ m_pDoc->deleteSpan(posCur, posCur+amt,NULL, iRealDeleteCount); -+ nBlock->remItemFromList(); -+ } -+ else -+ { -+ m_pDoc->deleteSpan(posCur, posCur+amt,NULL, iRealDeleteCount); -+ } -+ } -+ else -+ { -+ UT_DEBUGMSG(("deleteSpan - 2: posCur %d amt %d \n",posCur,amt)); -+ m_pDoc->deleteSpan(posCur, posCur+amt,NULL, iRealDeleteCount); -+ } -+ -+ if(fontFlag) -+ { -+ _makePointLegal(); -+ setCharFormat(properties); -+ } -+ } -+// -+// Dont leave a List field - tab on a line. -+// -+ if(isTabListAheadPoint()) -+ { -+ UT_uint32 iRealDeleteCount2; -+ -+ m_pDoc->deleteSpan(getPoint(), getPoint()+2,NULL,iRealDeleteCount2); -+ iRealDeleteCount += iRealDeleteCount2; -+ } -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ -+ _generalUpdate(); -+ g_free(props_in); -+ -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ -+ //special handling is required for delete in revisions mode -+ //where we have to move the insertion point -+ // only if we are deleting forward; if deleting backwards, the -+ // code above already moved the insertion point -+ // -+ // Tomas, Oct 28, 2003 -+ // do this if we deleted fewer than count characters -+ if(bForward && isMarkRevisions() && (iRealDeleteCount < count)) -+ { -+ UT_ASSERT( iRealDeleteCount <= count ); -+ _charMotion(bForward,count - iRealDeleteCount); -+ } -+ } -+ -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _setPoint(getPoint()); -+ notifyListeners(AV_CHG_MOTION | AV_CHG_ALL); -+ -+} -+ -+ -+void FV_View::cmdScroll(AV_ScrollCmd cmd, UT_uint32 iPos) -+{ -+#define HACK_LINE_HEIGHT 20 // TODO Fix this!! -+ -+ UT_sint32 lineHeight = iPos; -+ UT_sint32 docHeight = 0; -+ bool bVertical = false; -+ bool bHorizontal = false; -+ -+ docHeight = m_pLayout->getHeight(); -+ -+ if (lineHeight == 0) -+ lineHeight = m_pG->tlu(HACK_LINE_HEIGHT); -+ -+ UT_sint32 yoff = m_yScrollOffset; -+ UT_sint32 xoff = m_xScrollOffset; -+ -+ switch(cmd) -+ { -+ case AV_SCROLLCMD_PAGEDOWN: -+ yoff += getWindowHeight(); -+ bVertical = true; -+ break; -+ case AV_SCROLLCMD_PAGEUP: -+ yoff -= getWindowHeight(); -+ bVertical = true; -+ break; -+ case AV_SCROLLCMD_PAGELEFT: -+ xoff -= getWindowWidth(); -+ bHorizontal = true; -+ break; -+ case AV_SCROLLCMD_PAGERIGHT: -+ xoff += getWindowWidth(); -+ bHorizontal = true; -+ break; -+ case AV_SCROLLCMD_LINEDOWN: -+ yoff += lineHeight; -+ bVertical = true; -+ break; -+ case AV_SCROLLCMD_LINEUP: -+ yoff -= lineHeight; -+ bVertical = true; -+ break; -+ case AV_SCROLLCMD_LINELEFT: -+ xoff -= lineHeight; -+ bHorizontal = true; -+ break; -+ case AV_SCROLLCMD_LINERIGHT: -+ xoff += lineHeight; -+ bHorizontal = true; -+ break; -+ case AV_SCROLLCMD_TOTOP: -+ yoff = 0; -+ bVertical = true; -+ break; -+ case AV_SCROLLCMD_TOPOSITION: -+ UT_ASSERT(UT_NOT_IMPLEMENTED); -+ break; -+ case AV_SCROLLCMD_TOBOTTOM: -+ fp_Page* pPage = m_pLayout->getFirstPage(); -+ UT_sint32 iDocHeight = getPageViewTopMargin(); -+ while (pPage) -+ { -+ iDocHeight += pPage->getHeight() + getPageViewSep(); -+ pPage = pPage->getNext(); -+ } -+ yoff = iDocHeight; -+ bVertical = true; -+ break; -+ } -+ -+ if (yoff < 0) -+ yoff = 0; -+ -+ bool bRedrawPoint = true; -+ -+ if (bVertical && (yoff != m_yScrollOffset)) -+ { -+ sendVerticalScrollEvent(yoff); -+ if ((cmd != AV_SCROLLCMD_PAGEUP -+ && cmd != AV_SCROLLCMD_PAGEDOWN)) -+ bRedrawPoint = false; -+// UT_ASSERT(m_yScrollOffset == m_pG->getPrevYOffset()); -+ } -+ -+ if (xoff < 0) -+ xoff = 0; -+ -+ if (bHorizontal && (xoff != m_xScrollOffset)) -+ { -+ sendHorizontalScrollEvent(xoff); -+ bRedrawPoint = false; -+ } -+ -+ if (bRedrawPoint) -+ _fixInsertionPointCoords(); -+ -+} -+ -+ -+void FV_View::cmdSelect(PT_DocPosition dpBeg, PT_DocPosition dpEnd) -+{ -+ -+ if (!isSelectionEmpty()) -+ { -+ _clearSelection(); -+ } -+ _setPoint(dpBeg); -+ _setSelectionAnchor(); -+ m_Selection.setSelectionLeftAnchor(dpBeg); -+ if(dpBeg < dpEnd - 2) -+ { -+ if(m_pDoc->isTableAtPos(dpEnd) && m_pDoc->isEndTableAtPos(dpEnd-1)) -+ { -+ dpEnd--; -+ } -+ if(m_pDoc->isCellAtPos(dpEnd)) -+ { -+ dpEnd--; -+ } -+ } -+ m_Selection.setSelectionRightAnchor(dpEnd); -+ _setPoint (dpEnd); -+ UT_ASSERT(!isSelectionEmpty()); -+ -+ if (dpBeg == dpEnd) -+ { -+ return; -+ } -+ _drawSelection(); -+ notifyListeners(AV_CHG_EMPTYSEL); -+} -+ -+#define IS_SELECTALL(a, b) ((a) == FV_DOCPOS_BOD && (b) == FV_DOCPOS_EOD) -+ -+void FV_View::cmdSelect(UT_sint32 xPos, UT_sint32 yPos, FV_DocPos dpBeg, FV_DocPos dpEnd) -+{ -+ UT_DEBUGMSG(("Double click on mouse \n")); -+ -+ warpInsPtToXY(xPos, yPos,true); -+ PT_DocPosition iPosLeft = _getDocPos(dpBeg, false); -+ PT_DocPosition iPosRight = _getDocPos(dpEnd, false); -+ if(iPosLeft > iPosRight) -+ { -+ return; -+ } -+ if(!isInFrame(iPosLeft) && isInFrame(iPosRight)) -+ { -+ fl_FrameLayout * pFL = getFrameLayout(iPosRight); -+ iPosRight =pFL->getPosition(true)-1; -+ } -+ if(isInFrame(iPosLeft) && !isInFrame(iPosRight)) -+ { -+ fl_FrameLayout * pFL = getFrameLayout(iPosLeft); -+ iPosRight =pFL->getPosition(true) + pFL->getLength() -1; -+ } -+ if(iPosLeft == iPosRight) return; -+// -+// Code to select a paragraph break on selectLine if on first line of a Block. -+// -+ bool bRedraw = false; -+ if((dpBeg == FV_DOCPOS_BOL) || (dpBeg == FV_DOCPOS_BOP) || (dpBeg == FV_DOCPOS_BOD)) -+ { -+ fl_BlockLayout * pBlock = _findBlockAtPosition(iPosLeft); -+ if(pBlock) -+ { -+ UT_sint32 x, y, x2, y2, h; -+ bool b; -+ fp_Run* pRun = pBlock->findPointCoords(m_iInsPoint, false, x, y, x2, y2, h, b); -+ if(pRun) -+ { -+ fp_Line * pLine = pRun->getLine(); -+ if(pLine == static_cast(pBlock->getFirstContainer())) -+ { -+ PT_DocPosition iPosNew = pBlock->getPosition() -1; -+ if(iPosNew < iPosLeft) -+ { -+ iPosLeft = iPosNew; -+ } -+ bRedraw = true; // Need to trick a global redraw in -+ // header/footer -+ } -+ } -+ } -+ } -+ cmdSelect (iPosLeft, iPosRight); -+ if(bRedraw && isHdrFtrEdit()) -+ { -+ cmdSelect (iPosLeft+1, iPosRight); -+ } -+} -+ -+void FV_View::cmdHyperlinkJump(UT_sint32 xPos, UT_sint32 yPos) -+{ -+ _clearSelection(); -+ warpInsPtToXY(xPos, yPos,true); -+ -+ fl_BlockLayout * pBlock = getCurrentBlock(); -+ PT_DocPosition iRelPos = getPoint() - pBlock->getPosition(false); -+ -+ fp_Run *pRun = pBlock->getFirstRun(); -+ while (pRun && pRun->getBlockOffset()+ pRun->getLength() < iRelPos) -+ pRun= pRun->getNextRun(); -+ -+ UT_ASSERT(pRun); -+ pRun->getPrevRun(); -+ -+ UT_ASSERT(pRun); -+#if 0 -+ if(pRun->getType()== FPRUN_FMTMARK || pRun->getType()== FPRUN_HYPERLINK || pRun->getType()== FPRUN_BOOKMARK) -+ pRun = pRun->getNextRun(); -+ -+ UT_ASSERT(pRun); -+#endif -+ fp_HyperlinkRun * pH = pRun->getHyperlink(); -+ -+ UT_ASSERT(pH); -+ if(!pH) -+ return; -+ -+ const gchar * pTarget = pH->getTarget(); -+ -+ if(*pTarget == '#') -+ pTarget++; -+ -+ UT_uint32 iTargetLen = strlen(pTarget); -+ UT_UCSChar * pTargetU = new UT_UCSChar[iTargetLen+1]; -+ -+ UT_ASSERT(pTargetU); -+ -+ UT_UCSChar * pJump = pTargetU; -+ -+ for (UT_uint32 i = 0; i < iTargetLen; i++) -+ *pTargetU++ = (UT_UCSChar) *pTarget++; -+ *pTargetU = 0; -+ -+ gotoTarget(AP_JUMPTARGET_BOOKMARK, pJump); -+ -+ delete [] pJump; -+} -+ -+ -+void FV_View::cmdHyperlinkJump(PT_DocPosition pos) -+{ -+ fp_HyperlinkRun * pH = static_cast(getHyperLinkRun(pos)); -+ UT_ASSERT(pH); -+ if(!pH) -+ return; -+ -+ const gchar * pTarget = pH->getTarget(); -+ -+ if(*pTarget == '#') -+ pTarget++; -+ -+ UT_uint32 iTargetLen = strlen(pTarget); -+ UT_UCSChar * pTargetU = new UT_UCSChar[iTargetLen+1]; -+ -+ UT_ASSERT(pTargetU); -+ -+ UT_UCSChar * pJump = pTargetU; -+ -+ for (UT_uint32 i = 0; i < iTargetLen; i++) -+ *pTargetU++ = (UT_UCSChar) *pTarget++; -+ *pTargetU = 0; -+ -+ gotoTarget(AP_JUMPTARGET_BOOKMARK, pJump); -+ -+ delete [] pJump; -+} -+ -+void FV_View::cmdHyperlinkCopyLocation(PT_DocPosition pos) -+{ -+ fp_HyperlinkRun * pH = static_cast(getHyperLinkRun(pos)); -+ if(!pH) -+ return; -+ -+ const gchar * pTarget = pH->getTarget(); -+ -+ if(!pTarget || !*pTarget || !strcmp(pTarget,"#")) -+ return; -+ -+ //skip over internal anchors -+ if(*pTarget == '#') -+ pTarget++; -+ -+ //copy the target to the clipboard -+ copyTextToClipboard(pTarget, true); -+} -+ -+ -+void FV_View::cmdUndo(UT_uint32 count) -+{ -+ if (!isSelectionEmpty()) -+ _clearSelection(); -+ -+ // Signal PieceTable Change -+ m_pDoc->notifyPieceTableChangeStart(); -+ -+ // Turn off list updates -+ m_pDoc->disableListUpdates(); -+ -+// Don't update tables until finished -+ -+ m_pDoc->setDontImmediatelyLayout(true); -+ -+ // Remember the current position, We might need it later. -+ rememberCurrentPosition(); -+ UT_DEBUGMSG(("SEVIOR: undoing %d operations \n",count)); -+ m_pDoc->undoCmd(count); -+ allowChangeInsPoint(); -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+// -+// Now do a general update to make everything look good again. -+// -+ _generalUpdate(); -+ -+ notifyListeners(AV_CHG_DIRTY); -+ -+// Look to see if we need the saved insertion point after the undo -+// if(needSavedPosition()) -+// { -+// -+// We do, so restore insertion point to that value. -+// _setPoint(getSavedPosition()); -+// clearSavedPosition(); -+// } -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ -+ // Signal PieceTable Changes have finished -+ m_pDoc->notifyPieceTableChangeEnd(); -+ m_iPieceTableState = 0; -+ // Move insertion point out of field run if it is in one -+ // -+ _charMotion(true, 0); -+// -+// Do a complete update coz who knows what happened in the undo! -+// -+ notifyListeners(AV_CHG_ALL); -+ PT_DocPosition posEnd = 0; -+ PT_DocPosition posBOD = 0; -+ getEditableBounds(true, posEnd); -+ getEditableBounds(true, posBOD); -+ bool bOK = true; -+ while(bOK && !isPointLegal() && (getPoint() < posEnd)) -+ { -+ bOK = _charMotion(true,1); -+ } -+ -+ bOK = true; -+ while(bOK && !isPointLegal() && (getPoint() > posBOD)) -+ { -+ bOK = _charMotion(false,1); -+ } -+ setCursorToContext(); -+ -+ -+ _updateInsertionPoint(); -+} -+ -+void FV_View::cmdRedo(UT_uint32 count) -+{ -+ if (!isSelectionEmpty()) -+ _clearSelection(); -+ -+ // Signal PieceTable Change -+ m_pDoc->notifyPieceTableChangeStart(); -+ -+ // Turn off list updates -+ m_pDoc->disableListUpdates(); -+ m_pDoc->setDontImmediatelyLayout(true); -+ -+ // Remember the current position, We might need it later. -+ rememberCurrentPosition(); -+ -+ m_pDoc->redoCmd(count); -+ allowChangeInsPoint(); -+ -+// Look to see if we need the saved insertion point after the undo -+// if(needSavedPosition()) -+// { -+// -+// We do, so restore insertion point to that value. -+// -+// _setPoint(getSavedPosition()); -+// clearSavedPosition(); -+// } -+ m_pDoc->setDontImmediatelyLayout(false); -+ -+ // Signal PieceTable Changes have finished -+ m_pDoc->notifyPieceTableChangeEnd(); -+ m_iPieceTableState = 0; -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ -+ _generalUpdate(); -+ -+// -+// Do a complete update coz who knows what happened in the undo! -+// -+ PT_DocPosition posEnd = 0; -+ getEditableBounds(true, posEnd); -+ bool bOK = true; -+ bool bMoved = false; -+ while(bOK && !isPointLegal() && (getPoint() < posEnd)) -+ { -+ bOK = _charMotion(true,1); -+ bMoved = true; -+ } -+ if(getPoint() > posEnd) -+ { -+ setPoint(posEnd); -+ bMoved = true; -+ } -+ -+ bOK = true; -+ while(bOK && !isPointLegal() && (getPoint() > 2)) -+ { -+ bOK = _charMotion(false,1); -+ bMoved = true; -+ } -+ if(!bMoved && (getPoint() != posEnd)) -+ { -+ bOK = _charMotion(true,1); -+ bOK = _charMotion(false,1); -+ } -+ -+ setCursorToContext(); -+ _updateInsertionPoint(); -+ notifyListeners(AV_CHG_ALL); -+} -+ -+UT_Error FV_View::cmdSave(void) -+{ -+ // transfer any persistent properties into the doc -+ const gchar ** ppProps = getViewPersistentProps(); -+ m_pDoc->setProperties(ppProps); -+ -+ UT_Error tmpVar; -+ tmpVar = m_pDoc->save(); -+ if (!tmpVar) -+ { -+ notifyListeners(AV_CHG_SAVE); -+ } -+ return tmpVar; -+} -+ -+UT_Error FV_View::cmdSaveAs(const char * szFilename, int ieft, bool cpy) -+{ -+ // transfer any persistent properties into the doc -+ const gchar ** ppProps = getViewPersistentProps(); -+ m_pDoc->setProperties(ppProps); -+ -+ UT_Error tmpVar; -+ tmpVar = static_cast(m_pDoc)->saveAs(szFilename, ieft, cpy); -+ if (!tmpVar && cpy) -+ { -+ notifyListeners(AV_CHG_SAVE); -+ } -+ return tmpVar; -+} -+ -+UT_Error FV_View::cmdSaveAs(const char * szFilename, int ieft) -+{ -+ return cmdSaveAs(szFilename, ieft, true); -+} -+ -+ -+void FV_View::cmdCut(void) -+{ -+ if (isSelectionEmpty()) -+ { -+ // clipboard does nothing if there is no selection -+ return; -+ } -+ if(m_Selection.getSelectionMode() == FV_SelectionMode_TableColumn) -+ { -+ PD_DocumentRange * pDR = m_Selection.getNthSelection(0); -+ PT_DocPosition pos = 0; -+ if(pDR) -+ { -+ pos = pDR->m_pos1 +1; -+ } -+ else -+ { -+ pos = getSelectionAnchor(); -+ if(pos > getPoint()) -+ { -+ pos = getPoint(); -+ } -+ } -+ _clearSelection(); -+ cmdDeleteCol(pos); -+ return; -+ } -+ if(m_Selection.getSelectionMode() == FV_SelectionMode_TableRow) -+ { -+ PD_DocumentRange * pDR = m_Selection.getNthSelection(0); -+ PT_DocPosition pos = 0; -+ if(pDR) -+ { -+ pos = pDR->m_pos1 +1; -+ } -+ else -+ { -+ pos = getSelectionAnchor(); -+ if(pos > getPoint()) -+ { -+ pos = getPoint(); -+ } -+ } -+ _clearSelection(); -+ cmdDeleteRow(pos); -+ return; -+ } -+ // Signal PieceTable Change -+ m_pDoc->notifyPieceTableChangeStart(); -+ -+ // -+ // Disable list updates until after we've finished -+ // -+ m_pDoc->disableListUpdates(); -+ cmdCopy(true); -+ _deleteSelection(); -+ -+ // Signal PieceTable Changes have finished -+ m_pDoc->notifyPieceTableChangeEnd(); -+ m_iPieceTableState = 0; -+ _generalUpdate(); -+ -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ -+ _setPoint(getPoint()); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_ALL); -+ -+} -+ -+// bToClipboard is true if you want to copy to the CLIPBOARD -+// selection on UNIX, as opposed to some PRIMARY selection -+void FV_View::cmdCopy(bool bToClipboard) -+{ -+ if (isSelectionEmpty()) -+ { -+ // clipboard does nothing if there is no selection -+ return; -+ } -+ -+ PD_DocumentRange dr; -+ getDocumentRangeOfCurrentSelection(&dr); -+ m_pApp->copyToClipboard(&dr, bToClipboard); -+ notifyListeners(AV_CHG_CLIPBOARD); -+} -+ -+void FV_View::cmdPaste(bool bHonorFormatting) -+{ -+// -+// Look to see if should paste a table column or row -+// -+ if((m_Selection.getPrevSelectionMode() == FV_SelectionMode_TableColumn) -+ || (m_Selection.getPrevSelectionMode() == FV_SelectionMode_TableRow)) -+ { -+ if(isInTable()) -+ { -+ fl_TableLayout * pTab = getTableAtPos(getPoint()); -+ if(pTab && pTab == m_Selection.getTableLayout()) -+ { -+ m_Selection.pasteRowOrCol(); -+ return; -+ } -+ } -+ } -+ -+ // set UAG markers around everything that the actual paste does -+ // so that undo/redo will treat it as one step. -+ -+ m_pDoc->beginUserAtomicGlob(); -+ -+ // Signal PieceTable Change -+ m_pDoc->notifyPieceTableChangeStart(); -+ -+ // -+ // Disable list updates until after we've finished -+ // -+ m_pDoc->disableListUpdates(); -+ m_pDoc->setDoingPaste(); -+ setCursorWait(); -+ m_pDoc->setDontImmediatelyLayout(true); -+ _doPaste(true, bHonorFormatting); -+ // restore updates and clean up dirty lists -+ m_pDoc->enableListUpdates(); -+ m_pDoc->updateDirtyLists(); -+ clearCursorWait(); -+ -+ // Signal PieceTable Changes have finished -+ m_pDoc->notifyPieceTableChangeEnd(); -+ m_iPieceTableState = 0; -+ -+ m_pDoc->clearDoingPaste(); -+ m_pDoc->endUserAtomicGlob(); -+ m_iPieceTableState = 0; -+ // Move insertion point out of field run if it is in one -+ // -+ _charMotion(true, 0); -+ _makePointLegal(); -+// -+// Do a complete update coz who knows what happened in the paste! -+// -+ -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_ALL); -+} -+ -+void FV_View::cmdPasteSelectionAt(UT_sint32 xPos, UT_sint32 yPos) -+{ -+ // this is intended for the X11 middle mouse paste trick. -+ // -+ // if this view has the selection, we need to remember it -+ // before we warp to the given (x,y) -- or else there won't -+ // be a selection to paste when get there. this is sort of -+ // back door hack and should probably be re-thought. -+ -+ // set UAG markers around everything that the actual paste does -+ // so that undo/redo will treat it as one step. -+ -+ m_pDoc->beginUserAtomicGlob(); -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ if (!isSelectionEmpty()) -+ m_pApp->cacheCurrentSelection(this); -+ cmdCopy(false); -+ warpInsPtToXY(xPos,yPos,true); -+ _doPaste(false, true); -+ m_pApp->cacheCurrentSelection(NULL); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _fixInsertionPointCoords(); -+ _ensureInsertionPointOnScreen(); -+ -+ m_pDoc->endUserAtomicGlob(); -+ m_prevMouseContext = EV_EMC_TEXT; -+ notifyListeners(AV_CHG_ALL); -+} -+ -+UT_Error FV_View::cmdDeleteBookmark(const char* szName) -+{ -+ return _deleteBookmark(szName, true); -+} -+ -+UT_Error FV_View::cmdDeleteHyperlink() -+{ -+ PT_DocPosition pos = getPoint(); -+ UT_DEBUGMSG(("fv_View::cmdDeleteHyperlink: pos %d\n", pos)); -+ UT_Error err= _deleteHyperlink(pos,true); -+ m_prevMouseContext = EV_EMC_TEXT; -+ setCursorToContext(); -+ notifyListeners(AV_CHG_ALL); -+ return err; -+} -+ -+ -+UT_Error FV_View::cmdHyperlinkStatusBar(UT_sint32 xPos, UT_sint32 yPos) -+{ -+ UT_sint32 xClick, yClick; -+ fp_Page* pPage = _getPageForXY(xPos, yPos, xClick, yClick); -+ -+ PT_DocPosition pos; -+ bool bBOL = false; -+ bool bEOL = false; -+ bool isTOC = false; -+ pPage->mapXYToPosition(xClick, yClick, pos, bBOL, bEOL,isTOC); -+ -+ // now get the run at the position and the hyperlink run -+ fp_HyperlinkRun * pH1 = 0; -+ -+ fl_BlockLayout *pBlock = _findBlockAtPosition(pos); -+ PT_DocPosition curPos = pos - pBlock->getPosition(false); -+ -+ fp_Run * pRun = pBlock->getFirstRun(); -+ -+ //find the run at pos1 -+ while(pRun && pRun->getBlockOffset() <= curPos) -+ pRun = pRun->getNextRun(); -+ -+ // this sometimes happens, not sure why -+ //UT_ASSERT(pRun); -+ if(!pRun) -+ return false; -+ -+ // now we have the run immediately after the run in question, so -+ // we step back -+ pRun = pRun->getPrevRun(); -+ UT_ASSERT(pRun); -+ if(!pRun) -+ return false; -+ -+ xxx_UT_DEBUGMSG(("fv_View::cmdHyperlinkStatusBar: run 0x%x, type %d\n", pRun,pRun->getType())); -+ pH1 = pRun->getHyperlink(); -+ -+ // this happens after a deletion of a hyperlink -+ // the mouse processing is in the state of belief -+ // that the processing has not finished yet -- this is not specific -+ // to hyperlinks, it happens with anything on the context menu, except -+ // it goes unobserved since the cursor does not change -+ //UT_ASSERT(pH1); -+ if(!pH1) -+ return false; -+ xxx_UT_DEBUGMSG(("fv_View::cmdHyperlinkStatusBar: msg [%s]\n",pH1->getTarget())); -+ XAP_Frame * pFrame = static_cast (getParentData()); -+ UT_UTF8String url = pH1->getTarget(); -+ url.decodeURL(); -+ pFrame->setStatusMessage(url.utf8_str()); -+ return true; -+} -+ -+ -+UT_Error FV_View::cmdInsertHyperlink(const char * szName) -+{ -+ bool bRet; -+ -+ PT_DocPosition posStart = getPoint(); -+ PT_DocPosition posEnd = posStart; -+ PT_DocPosition iPointOrig = posStart; -+ PT_DocPosition iAnchorOrig = m_Selection.getSelectionAnchor(); -+ -+ if (!isSelectionEmpty()) -+ { -+ if (m_Selection.getSelectionAnchor() < posStart) -+ { -+ posStart = m_Selection.getSelectionAnchor(); -+ } -+ else -+ { -+ posEnd = m_Selection.getSelectionAnchor(); -+ } -+ -+ } -+ else -+ { -+ //No selection -+ XAP_Frame * pFrame = static_cast(getParentData()); -+ UT_ASSERT((pFrame)); -+ -+ pFrame->showMessageBox(AP_STRING_ID_MSG_HyperlinkNoSelection, XAP_Dialog_MessageBox::b_O, XAP_Dialog_MessageBox::a_OK); -+ return false; -+ } -+ -+ bool relLink = false; -+ if (!UT_go_path_is_uri(szName)) -+ relLink = m_pDoc->isBookmarkRelativeLink(szName); -+ // TODO: After strings freeze is lifted, we should -+ // TODO: display a message if relLink is true but -+ // TODO: szName does not stat. -+ -+ if(!UT_go_path_is_uri(szName) && m_pDoc->isBookmarkUnique(szName) && !relLink) -+ { -+ //No bookmark of that name in document, tell user. -+ XAP_Frame * pFrame = static_cast(getParentData()); -+ UT_ASSERT((pFrame)); -+ -+ pFrame->showMessageBox(AP_STRING_ID_MSG_HyperlinkNoBookmark, -+ XAP_Dialog_MessageBox::b_O, -+ XAP_Dialog_MessageBox::a_OK, -+ szName); -+ } -+ -+ // Hack for bug 2940 -+ if (posStart == 1) posStart++; -+ -+ // the selection has to be within a single block -+ // we could implement hyperlinks spaning arbitrary part of the document -+ // but then we could not use in the output and -+ // I see no obvious need for hyperlinks to span more than a single block -+ fl_BlockLayout * pBl1 = _findBlockAtPosition(posStart); -+ fl_BlockLayout * pBl2 = _findBlockAtPosition(posEnd); -+// -+// Handle corner case of selection from outside the left column -+// -+ if(isInFootnote(posStart)) -+ { -+ if((pBl1 != NULL) && (pBl1->getPosition(true) == posStart)) -+ { -+ if(posEnd > posStart+1) -+ { -+ posStart++; -+ } -+ } -+ } -+ if(isInEndnote(posStart)) -+ { -+ if((pBl1 != NULL) && (pBl1->getPosition(true) == posStart)) -+ { -+ if(posEnd > posStart+1) -+ { -+ posStart++; -+ } -+ } -+ } -+ if(pBl1 != pBl2) -+ { -+ XAP_Frame * pFrame = static_cast(getParentData()); -+ UT_ASSERT((pFrame)); -+ -+ pFrame->showMessageBox(AP_STRING_ID_MSG_HyperlinkCrossesBoundaries, XAP_Dialog_MessageBox::b_O, XAP_Dialog_MessageBox::a_OK); -+ -+ return false; -+ } -+ if(isTOCSelected()) -+ { -+// -+// Fixme place message box here -+// -+ return false; -+ -+ } -+ // Silently fail (TODO: pop up message) if we try to nest hyperlinks. -+ if (_getHyperlinkInRange(posStart, posEnd) != NULL) -+ return false; -+// -+// Under sum1 induced conditions posEnd could give the same block pointer -+// despite being past the end of the block. This extra fail-safe code -+// prevents this. -+// -+ if((pBl1->getPosition() + pBl1->getLength() -1) < posEnd) -+ { -+ return false; -+ } -+ gchar * pAttr[4]; -+ -+ UT_uint32 target_len = strlen(szName); -+ gchar * target = new gchar[ target_len+ 2]; -+ -+ if(UT_go_path_is_uri(szName) || relLink) -+ { -+ strncpy(target, static_cast(szName), target_len + 1); -+ } -+ else -+ { -+ target[0] = '#'; -+ strncpy(target + 1, static_cast(szName), target_len + 1); -+ } -+ -+ gchar target_l[] = "xlink:href"; -+ pAttr [0] = &target_l[0]; -+ pAttr [1] = &target[0]; -+ pAttr [2] = 0; -+ pAttr [3] = 0; -+ -+ UT_DEBUGMSG(("fv_View::cmdInsertHyperlink: target \"%s\"\n", target)); -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ // we first insert the end run, so that we can use it as a stop -+ // after inserting the start run when marking the runs in between -+ // as a hyperlink -+ bRet = m_pDoc->insertObject(posEnd, PTO_Hyperlink, NULL, NULL); -+ -+ if(bRet) -+ { -+ const gchar ** pAttrs = const_cast(pAttr); -+ const gchar ** pProps = 0; -+ bRet = m_pDoc->insertObject(posStart, PTO_Hyperlink, pAttrs, pProps); -+ } -+ -+ if(bRet) -+ { -+ // because we have inserted two objects around the selection -+ // boundaries the original insetion point and selection anchor -+ // are now shifted, so we need to fix them -+ setPoint(iPointOrig+1); -+ m_Selection.setSelectionAnchor(iAnchorOrig + 1); -+ } -+ -+ delete [] target; -+ -+ // Signal piceTable is stable again -+ _restorePieceTableState(); -+ -+ _generalUpdate(); -+ -+ return bRet; -+ -+} -+ -+/******************************************************************/ -+UT_Error FV_View::cmdInsertBookmark(const char * szName) -+{ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ bool bRet; -+ -+ PT_DocPosition posStart = getPoint(); -+ PT_DocPosition posEnd = posStart; -+ -+ if (!isSelectionEmpty()) -+ { -+ if (m_Selection.getSelectionAnchor() < posStart) -+ { -+ posStart = m_Selection.getSelectionAnchor(); -+ } -+ else -+ { -+ posEnd = m_Selection.getSelectionAnchor(); -+ } -+ } -+ -+ // we cannot bookmark lesser position than 2, because the bookmark object has to be located -+ // withing a block; this was the cause of bug 7128 -+ // (we might consider one day to allow the bookmark object before the first block strux, but the -+ // complications this would cause are possibly not worth it) -+ if(posStart < 2) -+ posStart = 2; -+ -+ posEnd++; -+ -+ fl_BlockLayout * pBL1 =_findBlockAtPosition(posStart); -+ fl_BlockLayout * pBL2 =_findBlockAtPosition(posEnd); -+// -+// Handle corner case of selection from outside the left column -+// -+ if((pBL1!= NULL) && isInFootnote(posStart) && (pBL1->getPosition(true) == posStart)) -+ { -+ if(posEnd > posStart+1) -+ { -+ posStart++; -+ } -+ } -+ if((pBL1 != NULL) && isInEndnote(posStart) && (pBL1->getPosition(true) == posStart)) -+ { -+ if(posEnd > posStart+1) -+ { -+ posStart++; -+ } -+ } -+ if(pBL1 != pBL2) -+ { -+// -+// Fixme put message boxes here -+// -+ _restorePieceTableState(); -+ return false; -+ } -+ if(isTOCSelected()) -+ { -+// -+// Fixme put message boxes here -+// -+ _restorePieceTableState(); -+ return false; -+ } -+ PT_DocPosition posNext = 0; -+ if(pBL1->getNext()) -+ { -+ posNext = pBL1->getNext()->getPosition(true); -+ } -+ else -+ { -+ posNext = pBL1->getPosition(true) + pBL1->getLength(); -+ } -+ if((posStart <= pBL1->getPosition(true)) || (posEnd > posNext)) -+ { -+ _restorePieceTableState(); -+ return false; -+ } -+ -+ if(!m_pDoc->isBookmarkUnique(static_cast(szName))) -+ { -+ //bookmark already exists -- remove it and then reinsert -+ UT_DEBUGMSG(("fv_View::cmdInsertBookmark: bookmark \"%s\" exists - removing\n", szName)); -+ _deleteBookmark(static_cast(szName), false, &posStart, &posEnd); -+ } -+ -+ gchar * pAttr[6]; -+ -+ gchar name_l [] = "name"; -+ gchar type_l [] = "type"; -+ gchar name[BOOKMARK_NAME_SIZE + 1]; -+ strncpy(name, static_cast(szName), BOOKMARK_NAME_SIZE); -+ name[BOOKMARK_NAME_SIZE] = 0; -+ -+ gchar type[] = "start"; -+ pAttr [0] = &name_l[0]; -+ pAttr [1] = &name[0]; -+ pAttr [2] = &type_l[0]; -+ pAttr [3] = &type[0]; -+ pAttr [4] = 0; -+ pAttr [5] = 0; -+ -+ UT_DEBUGMSG(("fv_View::cmdInsertBookmark: szName \"%s\"\n", szName)); -+ -+ const gchar ** pAttrs = const_cast(pAttr); -+ const gchar ** pProps = 0; -+ bRet = m_pDoc->insertObject(posStart, PTO_Bookmark, pAttrs, pProps); -+ -+ if(bRet) -+ { -+ strncpy(type,static_cast("end"), 3); -+ type[3] = 0; -+ bRet = m_pDoc->insertObject(posEnd, PTO_Bookmark, pAttrs, pProps); -+ } -+ -+ -+ // Signal piceTable is stable again -+ _restorePieceTableState(); -+ _generalUpdate(); -+ -+ return bRet; -+ -+} -+ -+ -+/*****************************************************************/ -+ -+ -+UT_Error FV_View::cmdInsertTOC(void) -+{ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ m_pDoc->beginUserAtomicGlob(); -+ bool bRet = false; // was not initialised; since ret value is -+ // UT_Error, false should correspond to OK. Tomas -+ -+ -+ if (!isSelectionEmpty()) -+ { -+ _deleteSelection(); -+ _generalUpdate(); -+ fl_BlockLayout * pBL = _findBlockAtPosition(getPoint()); -+ if(pBL != NULL) -+ { -+ fl_ContainerLayout * pCL = pBL->myContainingLayout(); -+ if(pCL->getContainerType() != FL_CONTAINER_DOCSECTION) -+ { -+ m_pDoc->endUserAtomicGlob(); -+ -+ // Signal piceTable is stable again -+ _restorePieceTableState(); -+ _generalUpdate(); -+ notifyListeners(AV_CHG_MOTION | AV_CHG_ALL); -+ return bRet; -+ } -+ } -+ else -+ { -+ m_pDoc->endUserAtomicGlob(); -+ -+ // Signal piceTable is stable again -+ _restorePieceTableState(); -+ _generalUpdate(); -+ notifyListeners(AV_CHG_MOTION | AV_CHG_ALL); -+ return bRet; -+ } -+ } -+// -+// Check if there is a hyperlink here -+// -+ if(getHyperLinkRun(getPoint()) != NULL) -+ { -+ return false; -+ } -+ if(!isPointLegal()) -+ { -+ _charMotion(true,1); -+ } -+ PT_DocPosition posEnd = 0; -+ getEditableBounds(true, posEnd); -+ if(getPoint() >= posEnd && !isPointLegal()) -+ { -+ _charMotion(false,1); -+ } -+// -+// Close off the current block -+// -+ insertParagraphBreak(); -+// -+// insert just before this block to make the TOC gets inserted just BEFORE -+// the Block we just created. -+// -+// we want this sort of structure in the PT -+// -+// | -+// | -+// Point is here after insert TOC-------------------------| -+// -+ fl_BlockLayout * pBL = getCurrentBlock(); -+ PT_DocPosition pos = pBL->getPosition(true); -+ if((pBL->getNext() == NULL) || (pBL->getPrev() == NULL)) -+ { -+ insertParagraphBreak(); -+ pBL = getCurrentBlock(); -+ pos = pBL->getPosition(true); -+ } -+ if(pBL != NULL) -+ { -+ fl_ContainerLayout * pCL = pBL->myContainingLayout(); -+ if(pCL->getContainerType() != FL_CONTAINER_DOCSECTION) -+ { -+ // Signal piceTable is stable again -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ notifyListeners(AV_CHG_MOTION | AV_CHG_ALL); -+ return bRet; -+ } -+ } -+ else -+ { -+ -+ // Signal piceTable is stable again -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ notifyListeners(AV_CHG_MOTION | AV_CHG_ALL); -+ return bRet; -+ } -+ m_pDoc->insertStrux(pos,PTX_SectionTOC); -+ pos++; -+ m_pDoc->insertStrux(pos,PTX_EndTOC); -+ setPoint(pos+1); -+ insertParaBreakIfNeededAtPos(getPoint()); -+ // -+ // Now move the point forward until we're in a legal position -+ // -+ _makePointLegal(); -+ // Signal piceTable is stable again -+ _restorePieceTableState(); -+ _generalUpdate(); -+ m_pDoc->endUserAtomicGlob(); -+ notifyListeners(AV_CHG_MOTION | AV_CHG_ALL); -+ -+ return bRet; -+ -+} -+ -+ -+/*****************************************************************/ -+UT_Error FV_View::cmdInsertField(const char* szName, const gchar ** extra_attrs, const gchar ** extra_props) -+{ -+ bool bResult = true; -+ -+/* -+ currently unused -+ fl_BlockLayout* pBL = _findBlockAtPosition(getPoint()); -+*/ -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ _insertField(szName, extra_attrs,extra_props); -+ -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ _generalUpdate(); -+ -+ _fixInsertionPointCoords(); -+ if (!_ensureInsertionPointOnScreen()) -+ { -+// -+// Handle End of Paragraph case -+// -+ PT_DocPosition posEOD; -+ getEditableBounds(true, posEOD); -+ if(getPoint() == posEOD) -+ { -+ m_bPointEOL = true; -+ } -+ _fixInsertionPointCoords(); -+ } -+ return bResult; -+} -+ -+UT_Error FV_View::cmdInsertGraphic(FG_Graphic* pFG) -+{ -+ bool bDidGlob = false; -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ if (!isSelectionEmpty() && !m_FrameEdit.isActive()) -+ { -+ bDidGlob = true; -+ m_pDoc->beginUserAtomicGlob(); -+ _deleteSelection(); -+ } -+ else if(m_FrameEdit.isActive()) -+ { -+ m_FrameEdit.setPointInside(); -+ } -+ /* -+ Create a unique identifier for the data item. -+ */ -+ UT_UUID *uuid = m_pDoc->getNewUUID(); -+ UT_return_val_if_fail(uuid != NULL, UT_ERROR); -+ UT_UTF8String s; -+ uuid->toString(s); -+ -+ UT_Error errorCode = _insertGraphic(pFG, s.utf8_str()); -+ if(m_FrameEdit.isActive()) -+ { -+ m_FrameEdit.setMode(FV_FrameEdit_NOT_ACTIVE); -+ } -+ -+ _restorePieceTableState(); -+ -+ _generalUpdate(); -+ if (bDidGlob) -+ m_pDoc->endUserAtomicGlob(); -+ _updateInsertionPoint(); -+ -+ return errorCode; -+} -+ -+UT_Error FV_View::cmdInsertPositionedGraphic(FG_Graphic* pFG) -+{ -+ fl_BlockLayout * pBlock = NULL; -+ fp_Run * pRun = NULL; -+ UT_sint32 xCaret, yCaret; -+ UT_uint32 heightCaret; -+ UT_sint32 xCaret2, yCaret2; -+ bool bDirection; -+ bool bEOL = false; -+ _findPositionCoords(getPoint(), bEOL, xCaret, yCaret, xCaret2, yCaret2, heightCaret, bDirection, &pBlock, &pRun); -+ UT_return_val_if_fail(pBlock,UT_ERROR); -+ return cmdInsertPositionedGraphic(pFG,xCaret,yCaret); -+ -+} -+ -+ -+UT_Error FV_View::cmdInsertPositionedGraphic(FG_Graphic* pFG,UT_sint32 mouseX, UT_sint32 mouseY) -+{ -+ m_pDoc->beginUserAtomicGlob(); -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ if (!isSelectionEmpty()) -+ { -+ _clearSelection(); -+ } -+ -+ /* -+ Create a unique identifier for the data item. -+ */ -+ UT_UUID *uuid = m_pDoc->getNewUUID(); -+ UT_return_val_if_fail(uuid != NULL, UT_ERROR); -+ UT_UTF8String s; -+ uuid->toString(s); -+ // -+ // Find a document position close to the requested position -+ // -+ PT_DocPosition pos = getDocPositionFromXY(mouseX,mouseY); -+ fl_BlockLayout * pBlock = getBlockAtPosition(pos); -+ fp_Run * pRun = NULL; -+ bool bEOL,bDir; -+ bEOL = false; -+ UT_sint32 x1,y1,x2,y2,iHeight; -+ if(pBlock) -+ { -+ pRun = pBlock->findPointCoords(pos,bEOL,x1,y1,x2,y2,iHeight,bDir); -+ } -+ fp_Line * pLine = pRun->getLine(); -+ if(pLine == NULL) -+ { -+ return false; -+ } -+ -+ // Also get max width, height -+ -+ fl_DocSectionLayout * pDSL = pBlock->getDocSectionLayout(); -+ double maxW = static_cast(pDSL->getActualColumnWidth())*0.5/UT_LAYOUT_RESOLUTION; -+ double maxH = static_cast(pDSL->getActualColumnHeight())*0.5/ UT_LAYOUT_RESOLUTION; -+ // -+ // OK calculate all the properties of this image -+ // -+ UT_String sWidth; -+ UT_String sHeight; -+ double ratw = 1.0; -+ double rath = 1.0; -+ double rat = 1.0; -+ double dw = static_cast(pFG->getWidth()); -+ double dh = static_cast(pFG->getHeight()); -+ -+ if(dw > maxW/2.) -+ { -+ ratw = maxW/dw; -+ } -+ if(dh > maxH/2.) -+ { -+ rath = maxH/dh; -+ } -+ if(ratw < rath) -+ { -+ rat = ratw; -+ } -+ else -+ { -+ rat = rath; -+ } -+ // This preserves the aspect ratio and limits the size of the images -+ dw = dw*rat; -+ dh = dh*rat; -+ sWidth = UT_formatDimensionedValue(dw,"in", NULL); -+ sHeight = UT_formatDimensionedValue(dh,"in", NULL); -+// -+// Create a dataid for the object -+// -+ -+ const char * dataID = pFG->createDataItem(m_pDoc,s.utf8_str()); -+ UT_String sFrameProps; -+ UT_String sProp; -+ UT_String sVal; -+ sProp = "frame-type"; -+ sVal = "image"; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+// -+// Turn off the borders. -+// -+ sProp = "top-style"; -+ sVal = "none"; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+ sProp = "right-style"; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+ sProp = "left-style"; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+ sProp = "bot-style"; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+// -+// Set width/Height -+// -+ sProp = "frame-width"; -+ sVal = sWidth; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+ sProp = "frame-height"; -+ sVal = sHeight; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+ double xpos = 0.0; -+ double ypos= 0.0; -+ -+ sProp = "position-to"; -+ sVal = "column-above-text"; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+ if(isInHdrFtr(pos)) -+ { -+ clearHdrFtrEdit(); -+ warpInsPtToXY(0,0,false); -+ pos = getPoint(); -+ } -+ -+// -+// Now calculate the Y offset to the Column -+// -+ fp_Column * pCol = static_cast(pLine->getColumn()); -+ ypos = static_cast(mouseY)/static_cast(UT_LAYOUT_RESOLUTION); -+ sProp = "frame-col-ypos"; -+ sVal = UT_formatDimensionedValue(ypos,"in", NULL); -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+ sProp = "wrap-mode"; -+ sVal = "wrapped-both"; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+ UT_sint32 iWidth = static_cast(dw*UT_LAYOUT_RESOLUTION); -+ UT_sint32 iposx = mouseX - pCol->getX() - iWidth/2; -+ UT_sint32 iColW = static_cast(maxW*2.*UT_LAYOUT_RESOLUTION); -+ if((iposx + iWidth) > (pCol->getX() + iColW)) -+ { -+ iposx = iColW - iWidth - pCol->getX(); -+ } -+ if(iposx < pCol->getX()) -+ { -+ iposx = 0; -+ } -+ -+ UT_DEBUGMSG(("iposx %d pCol->getX() %d \n",iposx,pCol->getX())); -+ xpos = static_cast(iposx)/static_cast(UT_LAYOUT_RESOLUTION); -+ -+ sProp = "frame-col-xpos"; -+ sVal = UT_formatDimensionedValue(xpos,"in", NULL); -+ UT_DEBUGMSG((" %s %s \n",sProp.c_str(),sVal.c_str())); -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+// -+// Wrapped Mode -+// -+ sProp = "wrap-mode"; -+ sVal = "wrapped-both"; -+ UT_String_setProperty(sFrameProps,sProp,sVal); -+// -+// Now define the Frame attributes strux -+// -+ const gchar * attributes[5] = {PT_STRUX_IMAGE_DATAID, -+ NULL,"props",NULL,NULL}; -+ attributes[1] = dataID; -+ attributes[3] = sFrameProps.c_str(); -+// -+// This should place the the frame strux immediately after the block containing -+// position posXY. -+// It returns the Frag_Strux of the new frame. -+// -+ fl_BlockLayout * pBL = pBlock; -+ if((pBL == NULL) || (pRun == NULL)) -+ { -+ return UT_ERROR; -+ } -+ fl_BlockLayout * pPrevBL = pBL; -+ while(pBL && ((pBL->myContainingLayout()->getContainerType() == FL_CONTAINER_ENDNOTE) || (pBL->myContainingLayout()->getContainerType() == FL_CONTAINER_FOOTNOTE) || (pBL->myContainingLayout()->getContainerType() == FL_CONTAINER_TOC)|| (pBL->myContainingLayout()->getContainerType() == FL_CONTAINER_FRAME))) -+ { -+ UT_DEBUGMSG(("Skipping Block %x \n",pBL)); -+ pPrevBL = pBL; -+ pBL = pBL->getPrevBlockInDocument(); -+ } -+ if(pBL == NULL) -+ { -+ pBL = pPrevBL; -+ } -+ UT_ASSERT((pBL->myContainingLayout()->getContainerType() != FL_CONTAINER_HDRFTR) -+ && (pBL->myContainingLayout()->getContainerType() != FL_CONTAINER_SHADOW)); -+ pos = pBL->getPosition(); -+ pf_Frag_Strux * pfFrame = NULL; -+ m_pDoc->insertStrux(pos,PTX_SectionFrame,attributes,NULL,&pfFrame); -+ PT_DocPosition posFrame = pfFrame->getPos(); -+ m_pDoc->insertStrux(posFrame+1,PTX_EndFrame); -+ insertParaBreakIfNeededAtPos(posFrame+2); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ m_pDoc->endUserAtomicGlob(); -+ _generalUpdate(); -+ if(!isPointLegal()) -+ { -+ _makePointLegal(); -+ } -+ _ensureInsertionPointOnScreen(); -+ notifyListeners(AV_CHG_MOTION | AV_CHG_ALL); -+ return UT_OK; -+} -+ -+/*! -+ * This method inserts a MathML object and it's Latex representation -+ * at the current insertion point. -+ * It leaves the Object selected so it can be altered as needed. -+ */ -+bool FV_View::cmdInsertLatexMath(UT_UTF8String & sLatex, -+ UT_UTF8String & sMath) -+{ -+ // -+ // First create the Data Items -+ // -+ UT_UTF8String sMathName; -+ UT_UTF8String sLatexName; -+ sMathName = "MathLatex"; -+ sLatexName = "LatexMath"; -+ UT_uint32 uid = m_pDoc->getUID(UT_UniqueId::Image); -+ UT_UTF8String sUID; -+ UT_UTF8String_sprintf(sUID,"%d",uid); -+ sMathName += sUID; -+ sLatexName += sUID; -+ // -+ // Insert these into the Piece Table -+ // -+ UT_ByteBuf mathBuf; -+ UT_ByteBuf latexBuf; -+ mathBuf.ins(0,reinterpret_cast(sMath.utf8_str()),static_cast(sMath.size())); -+ latexBuf.ins(0,reinterpret_cast(sLatex.utf8_str()),static_cast(sLatex.size())); -+ m_pDoc->createDataItem(sMathName.utf8_str(),false,&mathBuf,NULL,NULL); -+ m_pDoc->createDataItem(sLatexName.utf8_str(),false,&latexBuf,NULL,NULL); -+ // OK Insert the MathML Object -+ const gchar * atts[9]={"dataid",NULL,"latexid",NULL,"props",NULL,NULL,NULL,NULL}; -+ atts[1] = static_cast(sMathName.utf8_str()); -+ atts[3] = static_cast(sLatexName.utf8_str()); -+ const gchar *cur_style = NULL; -+ getStyle(&cur_style); -+ if((cur_style != NULL) && (*cur_style) && (strcmp(cur_style,"None") != 0)) -+ { -+ atts[6] = PT_STYLE_ATTRIBUTE_NAME; -+ atts[7] = cur_style; -+ } -+ -+ bool bDidGlob = false; -+ const gchar ** props = NULL; -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ PT_DocPosition pos = getPoint(); -+ if (!isSelectionEmpty()) -+ { -+ getCharFormat(&props,false,pos); -+ bDidGlob = true; -+ m_pDoc->beginUserAtomicGlob(); -+ _deleteSelection(); -+ } -+ else -+ { -+ getCharFormat(&props,false,pos); -+ } -+ pos = getPoint(); -+ UT_UTF8String sNewProps; -+ UT_UTF8String sProp; -+ UT_UTF8String sVal; -+ UT_sint32 i = 0; -+ if(props) -+ { -+ while(props[i] != NULL) -+ { -+ sProp = props[i]; -+ sVal = props[i+1]; -+ UT_UTF8String_setProperty(sNewProps,sProp,sVal); -+ i +=2; -+ } -+ g_free(props); -+ } -+ atts[5] = sNewProps.utf8_str(); -+ m_pDoc->insertObject(pos,PTO_Math,atts,NULL); -+ -+ if (bDidGlob) -+ m_pDoc->endUserAtomicGlob(); -+ -+ _generalUpdate(); -+ _restorePieceTableState(); -+ cmdSelect(pos,pos+1); -+ return true; -+} -+ -+/*! -+ * This method inserts a MathML object at the point presented. -+ * It assumes that a data item with a name of the supplied filename has -+ * already been inserted. -+ */ -+bool FV_View::cmdInsertMathML(const char * szUID,PT_DocPosition pos) -+{ -+ UT_DEBUGMSG(("Insert Math Object at %d name %s \n",pos,szUID)); -+ const gchar * atts[5]={"dataid",NULL,NULL,NULL,NULL}; -+ atts[1] = szUID; -+ const gchar *cur_style = NULL; -+ getStyle(&cur_style); -+ if((cur_style != NULL) && (*cur_style) && (strcmp(cur_style,"None") != 0)) -+ { -+ atts[2] = PT_STYLE_ATTRIBUTE_NAME; -+ atts[3] = cur_style; -+ } -+ bool bDidGlob = false; -+ const gchar ** props = NULL; -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ if (!isSelectionEmpty()) -+ { -+ bDidGlob = true; -+ m_pDoc->beginUserAtomicGlob(); -+ _deleteSelection(); -+ } -+ _makePointLegal(); -+ getCharFormat(&props,false,getPoint()); -+ m_pDoc->insertObject(getPoint(),PTO_Math,atts,props); -+ -+ if (bDidGlob) -+ m_pDoc->endUserAtomicGlob(); -+ -+ _generalUpdate(); -+ -+ _restorePieceTableState(); -+ _updateInsertionPoint(); -+ return true; -+} -+ -+ -+/*! -+ * This method inserts a Embed object at the point presented. -+ * The calling routine should pass in a pointer to bytebuf that represents the -+ * object. -+ * Also needed are strings for the Mime-type and the type of Embeded object. -+ * -+ * eg for a GNOME-Office chart we'll have MIME-TYPE "application/chart+xml" -+ * and sProps="embed-type: GOChart"; -+ */ -+bool FV_View::cmdInsertEmbed(UT_ByteBuf * pBuf,PT_DocPosition pos,const char * szMime,const char * szProps) -+{ -+ -+ const gchar * atts[7]={"dataid",NULL,"props",NULL,NULL,NULL,NULL}; -+ bool bRepeat = true; -+ UT_UTF8String sUID; -+ UT_uint32 uid = 0; -+ while(bRepeat) -+ { -+ uid = m_pDoc->getUID(UT_UniqueId::Image); -+ UT_UTF8String_sprintf(sUID,"%d",uid); -+ // -+ // Make sure data item is unique! -+ // -+ bRepeat = m_pDoc->getDataItemDataByName(sUID.utf8_str(),NULL,NULL,NULL); -+ } -+ atts[1] = sUID.utf8_str(); -+ const gchar *cur_style = NULL; -+ const char * mimetypeGOChart = g_strdup(szMime); -+ UT_String sBuf(reinterpret_cast(pBuf->getPointer(0)),pBuf->getLength()); -+ UT_DEBUGMSG(("Chart text is... \n %s \n",sBuf.c_str())); -+ bool result = m_pDoc->createDataItem(sUID.utf8_str(),false,pBuf,mimetypeGOChart, NULL); -+ if(!result) -+ { -+ return result; -+ } -+ getStyle(&cur_style); -+ if((cur_style != NULL) && (*cur_style) && (strcmp(cur_style,"None") != 0)) -+ { -+ atts[4] = PT_STYLE_ATTRIBUTE_NAME; -+ atts[5] = cur_style; -+ } -+ bool bDidGlob = false; -+ const gchar ** props = NULL; -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ if (!isSelectionEmpty()) -+ { -+ bDidGlob = true; -+ m_pDoc->beginUserAtomicGlob(); -+ _deleteSelection(); -+ // Reevaluate pos after deleting the selection -+ pos = getPoint(); -+ } -+ getCharFormat(&props,false,pos); -+ UT_UTF8String sFullProps; -+ UT_UTF8String sProp,sVal; -+ UT_UTF8String sProps; -+ UT_sint32 i = 0; -+ if(props) -+ { -+ for(i=0;props[i] != NULL;i+=2) -+ { -+ sProp = props[i]; -+ sVal = props[i+1]; -+ UT_UTF8String_setProperty(sFullProps,sProp,sVal); -+ } -+ g_free(props); -+ } -+ sProps = szProps; -+ UT_DEBUGMSG(("Supplied props %s \n",sProps.utf8_str())); -+ UT_UTF8String_addPropertyString(sFullProps,sProps); -+ UT_DEBUGMSG(("Property String at Update Object is %s \n",sFullProps.utf8_str())); -+ atts[3]=sFullProps.utf8_str(); -+ m_pDoc->insertObject(pos,PTO_Embed,atts,NULL); -+ if (bDidGlob) -+ m_pDoc->endUserAtomicGlob(); -+ -+ _generalUpdate(); -+ -+ _restorePieceTableState(); -+ _updateInsertionPoint(); -+ cmdSelect(pos,pos+1); -+ return true; -+} -+ -+/*! -+ * This method updates the Embedded object currently selected with a new -+ * object defined with the supplied bytebuffer, as well as strings to represent -+ * the MIME/Type and Object type. -+ * -+ * eg for a GNOME-Office chart we'll have MIME-TYPE "application/chart+xml" -+ * and sProps="embed-type: GOChart"; -+ */ -+bool FV_View::cmdUpdateEmbed(UT_ByteBuf * pBuf, const char * szMime, const char * szProps) -+{ -+ if (isSelectionEmpty()) -+ { -+ return false; -+ } -+ PT_DocPosition pos1 = getPoint(); -+ PT_DocPosition pos2 = getSelectionAnchor(); -+ PT_DocPosition posTemp = 0; -+ if(pos2 < pos1) -+ { -+ posTemp = pos2; -+ pos2 = pos1; -+ pos1 = posTemp; -+ } -+ fl_BlockLayout * pBL = getCurrentBlock(); -+ if(!pBL) -+ return false; -+ fp_Run * pRun; -+ UT_sint32 xPoint,yPoint,xPoint2,yPoint2,iPointHeight; -+ bool bDirection; -+ pRun = pBL->findPointCoords(pos1, false, xPoint, -+ yPoint, xPoint2, yPoint2, -+ iPointHeight, bDirection); -+ if(pRun && (pRun->getType() != FPRUN_EMBED) ) -+ { -+ pos1 = pos2; -+ } -+ pRun = pBL->findPointCoords(pos1, false, xPoint, -+ yPoint, xPoint2, yPoint2, -+ iPointHeight, bDirection); -+ if(pRun == NULL) -+ { -+ return false; -+ } -+ if(pRun->getType() != FPRUN_EMBED) -+ { -+ return false; -+ } -+ const gchar * atts[7]={"dataid",NULL,"props",NULL,NULL,NULL,NULL}; -+ bool bRepeat = true; -+ UT_UTF8String sUID; -+ UT_uint32 uid = 0; -+ while(bRepeat) -+ { -+ uid = m_pDoc->getUID(UT_UniqueId::Image); -+ UT_UTF8String_sprintf(sUID,"%d",uid); -+ // -+ // Make sure data item is unique! -+ // -+ bRepeat = m_pDoc->getDataItemDataByName(sUID.utf8_str(),NULL,NULL,NULL); -+ } -+ atts[1] = sUID.utf8_str(); -+ const char * mimetypeGOChart = g_strdup(szMime); -+ bool bres = m_pDoc->createDataItem(sUID.utf8_str(),false,pBuf,mimetypeGOChart, NULL); -+ UT_return_val_if_fail(bres,false) -+ const gchar *cur_style = NULL; -+ getStyle(&cur_style); -+ if((cur_style != NULL) && (*cur_style) && (strcmp(cur_style,"None") != 0)) -+ { -+ atts[4] = PT_STYLE_ATTRIBUTE_NAME; -+ atts[5] = cur_style; -+ } -+ const gchar ** props = NULL; -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ m_pDoc->beginUserAtomicGlob(); -+ getCharFormat(&props,false,pos1); -+ UT_UTF8String sFullProps; -+ UT_UTF8String sProp,sVal; -+ UT_UTF8String sProps; -+ sProps = szProps; -+ UT_sint32 i = 0; -+ if(props) -+ { -+ for(i=0;props[i] != NULL;i+=2) -+ { -+ sProp = props[i]; -+ sVal = props[i+1]; -+ UT_DEBUGMSG(("Update Embed Prop %s val %s \n",props[i],props[i+1])); -+ UT_UTF8String_setProperty(sFullProps,sProp,sVal); -+ } -+ g_free(props); -+ } -+ UT_DEBUGMSG(("Supplied props %s \n",sProps.utf8_str())); -+ UT_UTF8String_addPropertyString(sFullProps,sProps); -+ atts[3]=sFullProps.utf8_str(); -+ UT_DEBUGMSG(("Property String at Update Object is %s \n",atts[3])); -+ _deleteSelection(); -+ m_pDoc->insertObject(pos1,PTO_Embed,atts,NULL); -+ m_pDoc->endUserAtomicGlob(); -+ -+ _generalUpdate(); -+ _restorePieceTableState(); -+ _updateInsertionPoint(); -+ cmdSelect(pos1,pos1+1); -+ return true; -+} -+ -+/*! -+ * This method updates the Embedded object in pRun with a new -+ * object defined with the supplied bytebuffer, as well as strings to represent -+ * the MIME/Type and Object type. -+ * -+ * eg for a GNOME-Office chart we'll have MIME-TYPE "application/chart+xml" -+ * and sProps="embed-type: GOChart"; -+ */ -+bool FV_View::cmdUpdateEmbed(fp_Run * pRun, UT_ByteBuf * pBuf, const char * szMime, const char * szProps) -+{ -+ if(pRun == NULL || pRun->getType() != FPRUN_EMBED) -+ { -+ return false; -+ } -+ PT_DocPosition pos; -+ bool flag; -+ pRun->mapXYToPosition(0, 0, pos, flag, flag, flag); -+ cmdSelect (pos, pos+1); -+ const gchar * atts[7]={"dataid",NULL,"props",NULL,NULL,NULL,NULL}; -+ bool bRepeat = true; -+ UT_UTF8String sUID; -+ UT_uint32 uid = 0; -+ while(bRepeat) -+ { -+ uid = m_pDoc->getUID(UT_UniqueId::Image); -+ UT_UTF8String_sprintf(sUID,"%d",uid); -+ // -+ // Make sure data item is unique! -+ // -+ bRepeat = m_pDoc->getDataItemDataByName(sUID.utf8_str(),NULL,NULL,NULL); -+ } -+ atts[1] = sUID.utf8_str(); -+ const char * mimetypeGOChart = g_strdup(szMime); -+ bool bres = m_pDoc->createDataItem(sUID.utf8_str(),false,pBuf,mimetypeGOChart, NULL); -+ UT_return_val_if_fail(bres,false) -+ const gchar *cur_style = NULL; -+ getStyle(&cur_style); -+ if((cur_style != NULL) && (*cur_style) && (strcmp(cur_style,"None") != 0)) -+ { -+ atts[4] = PT_STYLE_ATTRIBUTE_NAME; -+ atts[5] = cur_style; -+ } -+ const gchar ** props = NULL; -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ m_pDoc->beginUserAtomicGlob(); -+ getCharFormat(&props,false,pos); -+ UT_UTF8String sFullProps; -+ UT_UTF8String sProp,sVal; -+ UT_UTF8String sProps; -+ sProps = szProps; -+ UT_sint32 i = 0; -+ if(props) -+ { -+ for(i=0;props[i] != NULL;i+=2) -+ { -+ sProp = props[i]; -+ // Filter out size properties -+ if (sProp == "width" || sProp == "height" || sProp == "descent" -+ || sProp == "ascent") -+ sVal=NULL; -+ else -+ sVal = props[i+1]; -+ UT_DEBUGMSG(("Update Embed Prop %s val %s \n",props[i],props[i+1])); -+ UT_UTF8String_setProperty(sFullProps,sProp,sVal); -+ } -+ g_free(props); -+ } -+ UT_DEBUGMSG(("Supplied props %s \n",sProps.utf8_str())); -+ UT_UTF8String_addPropertyString(sFullProps,sProps); -+ atts[3]=sFullProps.utf8_str(); -+ UT_DEBUGMSG(("Property String at Update Object is %s \n",atts[3])); -+ m_pDoc->changeSpanFmt(PTC_AddFmt, pos, pos+1, atts, NULL); -+ m_pDoc->endUserAtomicGlob(); -+ -+ _generalUpdate(); -+ _restorePieceTableState(); -+ _updateInsertionPoint(); -+ cmdSelect(pos,pos+1); -+ return true; -+} -+ -+/*! -+ * This method deletes the Embedded object in pRun. -+ */ -+bool FV_View::cmdDeleteEmbed(fp_Run * pRun) -+{ -+ if(pRun == NULL || pRun->getType() != FPRUN_EMBED) -+ { -+ return false; -+ } -+ PT_DocPosition pos; -+ bool flag; -+ pRun->mapXYToPosition(0, 0, pos, flag, flag, flag); -+ cmdSelect (pos, pos+1); -+ _saveAndNotifyPieceTableChange(); -+ m_pDoc->beginUserAtomicGlob(); -+ _deleteSelection(); -+ m_pDoc->endUserAtomicGlob(); -+ -+ _generalUpdate(); -+ _restorePieceTableState(); -+ _updateInsertionPoint(); -+ cmdSelect(pos,pos); -+ return true; -+} -+ -+/*! -+ * This method inserts an image at the strux of type iStruxType at the -+ * point given by ipos. -+ * This is useful for speficifying images as backgrounds to pages and cells. -+ */ -+UT_Error FV_View::cmdInsertGraphicAtStrux(FG_Graphic* pFG, PT_DocPosition iPos, PTStruxType iStruxType) -+{ -+ bool bDidGlob = false; -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ /* -+ Create a unique identifier for the data item. -+ */ -+ UT_UUID *uuid = m_pDoc->getNewUUID(); -+ UT_return_val_if_fail(uuid != NULL, UT_ERROR); -+ UT_UTF8String s; -+ uuid->toString(s); -+ -+ UT_Error errorCode = pFG->insertAtStrux(m_pDoc, -+ m_pG->getDeviceResolution(), -+ iPos, -+ iStruxType, s.utf8_str()); -+ -+ _restorePieceTableState(); -+ -+ _generalUpdate(); -+ if (bDidGlob) -+ m_pDoc->endUserAtomicGlob(); -+ _updateInsertionPoint(); -+ -+ return errorCode; -+} -+ -+#ifdef ENABLE_SPELL -+void FV_View::cmdContextSuggest(UT_uint32 ndx, fl_BlockLayout * ppBL, -+ fl_PartOfBlock * ppPOB) -+{ -+ // locate the squiggle -+ PT_DocPosition pos = getPoint(); -+ fl_BlockLayout* pBL; -+ fl_PartOfBlock* pPOB; -+ -+ if (!ppBL) -+ pBL = _findBlockAtPosition(pos); -+ else -+ pBL = ppBL; -+ UT_ASSERT(pBL); -+ -+ if (!ppPOB) -+ pPOB = pBL->getSpellSquiggles()->get(pos - pBL->getPosition()); -+ else -+ pPOB = ppPOB; -+ UT_ASSERT(pPOB); -+ -+ // grab the suggestion -+ UT_UCSChar * replace = _lookupSuggestion(pBL, pPOB, ndx); -+ -+ if (!replace) -+ return; -+ -+ // make the change -+ UT_ASSERT(isSelectionEmpty()); -+ -+ moveInsPtTo(static_cast(pBL->getPosition() + pPOB->getOffset())); -+ extSelHorizontal(true, pPOB->getPTLength()); -+ -+ UT_UCSChar * selection; -+ getSelectionText(selection); -+ getDictForSelection ()->correctWord (selection, UT_UCS4_strlen (selection), -+ replace, UT_UCS4_strlen (replace)); -+ cmdCharInsert(replace, UT_UCS4_strlen(replace)); -+ FREEP(selection); -+ FREEP(replace); -+} -+ -+void FV_View::cmdContextIgnoreAll(void) -+{ -+ // locate the squiggle -+ PT_DocPosition pos = getPoint(); -+ fl_BlockLayout* pBL = _findBlockAtPosition(pos); -+ UT_ASSERT(pBL); -+ fl_PartOfBlock* pPOB = pBL->getSpellSquiggles()->get(pos - pBL->getPosition()); -+ UT_ASSERT(pPOB); -+ -+ // grab a copy of the word -+ UT_GrowBuf pgb(1024); -+ bool bRes = pBL->getBlockBuf(&pgb); -+ UT_ASSERT(bRes); -+ -+ const UT_UCSChar * pBuf; -+ UT_sint32 iLength, iPTLength, iBlockPos; -+ -+ fl_BlockSpellIterator BSI(pBL, pPOB->getOffset()); -+ BSI.nextWordForSpellChecking(pBuf, iLength, iBlockPos, iPTLength); -+ -+ // make the change -+ getDictForSelection ()->ignoreWord ((const UT_UCSChar *)pBuf, (size_t)iLength); -+ { -+ // remove the squiggles, too -+ fl_DocSectionLayout * pSL = m_pLayout->getFirstSection(); -+ if(pSL) -+ { -+ fl_BlockLayout* b = pSL->getNextBlockInDocument(); -+ while (b) -+ { -+ // TODO: just check and remove matching squiggles -+ // for now, destructively recheck the whole thing -+ m_pLayout->queueBlockForBackgroundCheck(FL_DocLayout::bgcrSpelling, b); -+ b = static_cast(b->getNextBlockInDocument()); -+ } -+ } -+ } -+} -+ -+void FV_View::cmdContextAdd(void) -+{ -+ // locate the squiggle -+ PT_DocPosition pos = getPoint(); -+ fl_BlockLayout* pBL = _findBlockAtPosition(pos); -+ UT_return_if_fail(pBL); -+ fl_PartOfBlock* pPOB = pBL->getSpellSquiggles()->get(pos - pBL->getPosition()); -+ if(!pPOB) // this can happen with very rapid right-clicks -+ { -+ return; -+ } -+ -+ // grab a copy of the word -+ UT_GrowBuf pgb(1024); -+ bool bRes = pBL->getBlockBuf(&pgb); -+ UT_ASSERT(bRes); -+ -+ const UT_UCSChar * pBuf; -+ UT_sint32 iLength, iPTLength, iBlockPos; -+ -+ fl_BlockSpellIterator BSI(pBL, pPOB->getOffset()); -+ BSI.nextWordForSpellChecking(pBuf, iLength, iBlockPos, iPTLength); -+ -+ // make the change -+ if (getDictForSelection ()->addToCustomDict (pBuf, iLength)) -+ { -+ // remove the squiggles, too -+ fl_DocSectionLayout * pSL = m_pLayout->getFirstSection(); -+ if(pSL) -+ { -+ fl_BlockLayout* b = pSL->getNextBlockInDocument(); -+ while (b) -+ { -+ // TODO: just check and remove matching squiggles -+ // for now, destructively recheck the whole thing -+ if(b->getContainerType() == FL_CONTAINER_BLOCK) -+ { -+ m_pLayout->queueBlockForBackgroundCheck(FL_DocLayout::bgcrSpelling, b); -+ b = static_cast(b->getNextBlockInDocument()); -+ } -+ else -+ { -+ b = static_cast(b->getNext()); -+ } -+ } -+ } -+ } -+} -+#endif -+ -+ -+/*! -+ * Remove all the Headers or footers from the section owning the current Page. -+\param bool isHeader remove the header if true, the footer if false. -+*/ -+void FV_View::cmdRemoveHdrFtr( bool isHeader) -+{ -+// -+// Branch to Header/Footer sections. -+// -+ fp_ShadowContainer * pHFCon = NULL; -+ fl_HdrFtrShadow * pShadow = NULL; -+ fl_HdrFtrSectionLayout * pHdrFtr = NULL; -+ -+ if(isHeader) -+ { -+ fp_Page * pPage = getCurrentPage(); -+ pHFCon = pPage->getHdrFtrP(FL_HDRFTR_HEADER); -+ if(pHFCon == NULL) -+ { -+ return; -+ } -+// -+// Now see if we are in the header to be removed. If so, jump out. -+// -+ if (!isSelectionEmpty()) -+ _clearSelection(); -+ if(isHdrFtrEdit()) -+ { -+ clearHdrFtrEdit(); -+ _setPoint(pPage->getFirstLastPos(true)); -+ } -+ } -+ else -+ { -+ fp_Page * pPage = getCurrentPage(); -+ pHFCon = pPage->getHdrFtrP(FL_HDRFTR_FOOTER); -+ if(pHFCon == NULL) -+ { -+ return; -+ } -+// -+// Now see if we are in the Footer to be removed. If so, jump out. -+// -+ if (!isSelectionEmpty()) -+ _clearSelection(); -+ if(isHdrFtrEdit()) -+ { -+ clearHdrFtrEdit(); -+ _setPoint(pPage->getFirstLastPos(false)); -+ } -+ } -+ pShadow = pHFCon->getShadow(); -+ UT_ASSERT(pShadow); -+ if(!pShadow) -+ return; -+ -+ m_pDoc->beginUserAtomicGlob(); -+ -+ _saveAndNotifyPieceTableChange(); -+// -+// Save current document position. -+// -+ PT_DocPosition curPoint = getPoint(); -+// -+// Get the hdrftrSectionLayout -+// Get it's position. -+// Find the last run in the Section and get it's position. -+// -+// Need code here to remove all the header/footers. -+// -+ pHdrFtr = pShadow->getHdrFtrSectionLayout(); -+ fl_DocSectionLayout * pDSL = pHdrFtr->getDocSectionLayout(); -+// -+// Repeat this code 4 times to remove all the DocSection Layouts. -+// -+ setCursorWait(); -+ if(isHeader) -+ { -+ pHdrFtr = pDSL->getHeader(); -+ if(pHdrFtr) -+ { -+ _removeThisHdrFtr(pHdrFtr); -+ } -+ pHdrFtr = pDSL->getHeaderEven(); -+ if(pHdrFtr) -+ { -+ _removeThisHdrFtr(pHdrFtr); -+ } -+ pHdrFtr = pDSL->getHeaderFirst(); -+ if(pHdrFtr) -+ { -+ _removeThisHdrFtr(pHdrFtr); -+ } -+ pHdrFtr = pDSL->getHeaderLast(); -+ if(pHdrFtr) -+ { -+ _removeThisHdrFtr(pHdrFtr); -+ } -+ } -+ else -+ { -+ pHdrFtr = pDSL->getFooter(); -+ if(pHdrFtr) -+ { -+ _removeThisHdrFtr(pHdrFtr); -+ } -+ pHdrFtr = pDSL->getFooterEven(); -+ if(pHdrFtr) -+ { -+ _removeThisHdrFtr(pHdrFtr); -+ } -+ pHdrFtr = pDSL->getFooterFirst(); -+ if(pHdrFtr) -+ { -+ _removeThisHdrFtr(pHdrFtr); -+ } -+ pHdrFtr = pDSL->getFooterLast(); -+ if(pHdrFtr) -+ { -+ _removeThisHdrFtr(pHdrFtr); -+ } -+ } -+// -+// After erarsing the cursor, Restore to the point before all this mess started. -+// -+ _setPoint(curPoint); -+ -+ // Signal PieceTable Changes have finished -+ _restorePieceTableState(); -+ -+ _generalUpdate(); -+ updateScreen (); // fix 1803, force screen update/redraw -+ -+ _updateInsertionPoint(); -+ m_pDoc->endUserAtomicGlob(); -+ clearCursorWait(); -+ notifyListeners (AV_CHG_HDRFTR | AV_CHG_FMTSECTION); -+} -+ -+/*! -+ * Start edit header mode. If there is no header one will be inserted. -+ * otherwise start editing the header on the current page. -+ */ -+void FV_View::cmdEditHeader(void) -+{ -+ _cmdEditHdrFtr(FL_HDRFTR_HEADER); -+ notifyListeners (AV_CHG_HDRFTR | AV_CHG_FMTSECTION); -+} -+ -+/*! -+ * Start edit footer mode. If there is no footer one will be inserted. -+ * otherwise start editing the footer on the current page. -+ */ -+void FV_View::cmdEditFooter(void) -+{ -+ _cmdEditHdrFtr(FL_HDRFTR_FOOTER); -+ notifyListeners (AV_CHG_HDRFTR | AV_CHG_FMTSECTION); -+} -+ -+void FV_View::cmdAcceptRejectRevision(bool bReject, UT_sint32 xPos, UT_sint32 yPos) -+{ -+ UT_DEBUGMSG(( "FV_View::cmdAcceptRejectRevision [bReject=%d]\n",bReject )); -+ -+ PT_DocPosition iStart, iEnd; -+ fl_BlockLayout * pBlock = NULL; -+ fp_Run *pRun = NULL; -+ -+ // Signal PieceTable Change -+ _saveAndNotifyPieceTableChange(); -+ -+ if(isSelectionEmpty()) -+ { -+ if(xPos || yPos) // if given 0,0 use current position -+ { -+ warpInsPtToXY(xPos, yPos,true); -+ } -+ -+ pBlock = getCurrentBlock(); -+ PT_DocPosition iRelPos = getPoint() - pBlock->getPosition(false); -+ -+ pRun = pBlock->getFirstRun(); -+ while (pRun && pRun->getNextRun() && pRun->getBlockOffset()+ pRun->getLength() <= iRelPos) -+ pRun= pRun->getNextRun(); -+ -+ UT_return_if_fail(pRun); -+ -+ iStart = pBlock->getPosition(false) + pRun->getBlockOffset(); -+ iEnd = pBlock->getPosition(false) + pRun->getBlockOffset() + pRun->getLength(); -+ -+ } -+ else -+ { -+ iStart = getPoint(); -+ iEnd = getSelectionAnchor(); -+ } -+ -+ // remove the selection, since things will get inserted, deleted, etc. -+ _clearSelection(); -+ -+ m_pDoc->acceptRejectRevision(bReject,iStart,iEnd,m_iViewRevision); -+ _restorePieceTableState(); -+ _generalUpdate(); -+} -+ -+void FV_View::cmdSetRevisionLevel(UT_uint32 i) -+{ -+ UT_return_if_fail( i <= PD_MAX_REVISION ); -+ // first set the same level in Doc; we do this unconditionally, -+ // this way the doc will always save the level the user last used -+ // NB: the doc id and the view id can be differnt if the user -+ // changed it in some other view -+ m_pDoc->setShowRevisionId(i); -+ -+ if(m_iViewRevision != i) -+ { -+ m_iViewRevision = i; -+ -+ // need to rebuild the doc to reflect the new level ... -+ m_pLayout->rebuildFromHere(static_cast(m_pLayout->getFirstSection())); -+ -+ // we have to force redraw here, see bug 10486 -+ draw(NULL); -+ } -+} -+ -+/*! -+ finds the next/previous revision and sets selection to it -+ TODO the selection will not cross block boundaries; it probably should -+ -+ \param bNext: if true the search is carried out in forward direction -+ \return returns true on succes -+*/ -+bool FV_View::cmdFindRevision(bool bNext, UT_sint32 xPos, UT_sint32 yPos) -+{ -+ if(xPos || yPos) -+ { -+ // this is the case we were called from context menu ... -+ warpInsPtToXY(xPos, yPos,true); -+ } -+ -+ if(!isSelectionEmpty()) -+ { -+ _moveToSelectionEnd(bNext); -+ } -+ -+ fl_BlockLayout * pBL = getCurrentBlock(); -+ -+ if(!pBL) -+ return false; -+ -+ fl_DocSectionLayout * pSL = pBL->getDocSectionLayout(); -+ -+ if(!pSL) -+ return false; -+ -+ fp_Run * pRun; -+ UT_sint32 xPoint,yPoint,xPoint2,yPoint2,iPointHeight; -+ bool bDirection; -+ -+ pRun = pBL->findPointCoords(getPoint(), false, xPoint, -+ yPoint, xPoint2, yPoint2, -+ iPointHeight, bDirection); -+ -+ if(!pRun) -+ return false; -+ -+ if(bNext) -+ { -+ pRun = pRun->getNextRun(); -+ -+ while(pSL) -+ { -+ while(pBL) -+ { -+ while(pRun) -+ { -+ if(pRun->containsRevisions() && !pRun->isHidden()) -+ { -+ goto move_point; -+ } -+ -+ pRun = pRun->getNextRun(); -+ } -+ -+ pBL = pBL->getNextBlockInDocument(); -+ } -+ -+ pSL = pSL->getNextDocSection(); -+ } -+ } -+ else -+ { -+ pRun = pRun->getPrevRun(); -+ -+ while(pSL) -+ { -+ while(pBL) -+ { -+ while(pRun) -+ { -+ if(pRun->containsRevisions() && !pRun->isHidden()) -+ { -+ goto move_point; -+ } -+ -+ pRun = pRun->getPrevRun(); -+ } -+ -+ pBL = pBL->getPrevBlockInDocument(); -+ } -+ -+ pSL = pSL->getPrevDocSection(); -+ } -+ } -+ -+ return false; -+ -+ move_point: -+ UT_return_val_if_fail(pRun && pBL, false); -+ -+ // we want to span the selection not only over this run, but also -+ // all subesequent runs that contain the same revions -+ // TODO: probably should do this across block/section boundaries -+ fp_Run * pRun2 = bNext ? pRun->getNextRun() : pRun->getPrevRun(); -+ fp_Run * pOldRun2 = pRun; -+ -+ PP_RevisionAttr * pR1 = pRun->getRevisions(); -+ -+ while(pRun2) -+ { -+ if(pRun2->containsRevisions() && !pRun2->isHidden()) -+ { -+ // test the two runs, if their revions are the same -+ // include this one as well -+ PP_RevisionAttr * pR2 = pRun2->getRevisions(); -+ -+ if(!(*pR1 == *pR2)) -+ break; -+ } -+ else -+ { -+ break; -+ } -+ -+ pOldRun2 = pRun2; -+ pRun2 = bNext ? pRun2->getNextRun() : pRun2->getPrevRun(); -+ } -+ -+ // backtrack (we want pRun2 to be the last run in the selection -+ pRun2 = pOldRun2; -+ UT_return_val_if_fail(pRun2, false); -+ -+ PT_DocPosition dpos1, dpos2; -+ -+ if(bNext) -+ { -+ dpos1 = pBL->getPosition() + pRun->getBlockOffset(); -+ dpos2 = pRun2->getBlock()->getPosition() + pRun2->getBlockOffset() + pRun2->getLength(); -+ } -+ else -+ { -+ dpos1 = pRun2->getBlock()->getPosition() + pRun2->getBlockOffset(); -+ dpos2 = pBL->getPosition() + pRun->getBlockOffset() + pRun->getLength(); -+ } -+ -+ cmdSelect(dpos1, dpos2); -+ -+ return true; -+} -diff -urNad abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_TOC.cpp abiword-2.6.2/abiword/src/wp/impexp/xp/ie_TOC.cpp ---- abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_TOC.cpp 2008-04-17 13:12:33.000000000 +0200 -+++ abiword-2.6.2/abiword/src/wp/impexp/xp/ie_TOC.cpp 2008-04-17 21:45:40.000000000 +0200 -@@ -149,6 +149,11 @@ - - switch (pcrx->getStruxType()) - { -+ case PTX_SectionTOC: -+ { -+ mTOC->mDocHasTOC = true; -+ return true; -+ } - case PTX_Block: - { - const PP_AttrProp * pAP = NULL; -@@ -202,7 +207,7 @@ - /*******************************************************************************/ - - IE_TOCHelper::IE_TOCHelper(PD_Document * pDoc) -- : mHasTOC(false), mDoc(pDoc) -+ : mHasTOC(false), mDocHasTOC(false), mDoc(pDoc) - { - TOC_Listener listener(pDoc,this); - -@@ -219,6 +224,11 @@ - return mHasTOC; - } - -+bool IE_TOCHelper::docHasTOC() const -+{ -+ return mDocHasTOC; -+} -+ - bool IE_TOCHelper::_tocNameLevelHelper(const UT_UTF8String & style_name, - const char * base_name) const - { -diff -urNad abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_TOC.h abiword-2.6.2/abiword/src/wp/impexp/xp/ie_TOC.h ---- abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_TOC.h 2008-04-17 13:12:33.000000000 +0200 -+++ abiword-2.6.2/abiword/src/wp/impexp/xp/ie_TOC.h 2008-04-17 21:45:40.000000000 +0200 -@@ -15,7 +15,8 @@ - IE_TOCHelper(PD_Document * doc); - ~IE_TOCHelper(); - -- bool hasTOC() const; -+ bool hasTOC() const; // true if there are any "headings" in the document -+ bool docHasTOC() const; // true if the doc has 1 or more tables of contents - - bool isTOCStyle(const UT_UTF8String & styleName, int * out_level = NULL) const; - bool isTOCStyle(const char * styleName, int * out_level = NULL) const; -@@ -41,6 +42,7 @@ - UT_GenericVector mTOCLevels; - - bool mHasTOC; -+ bool mDocHasTOC; - PD_Document *mDoc; - }; - -diff -urNad abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_exp_HTML.cpp abiword-2.6.2/abiword/src/wp/impexp/xp/ie_exp_HTML.cpp ---- abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_exp_HTML.cpp 2008-04-17 13:12:33.000000000 +0200 -+++ abiword-2.6.2/abiword/src/wp/impexp/xp/ie_exp_HTML.cpp 2008-04-17 21:45:40.000000000 +0200 -@@ -2301,7 +2301,7 @@ - tagPending = true; - bClassAsTag = true; - -- if (m_toc) { -+ if (m_toc->docHasTOC()) { - m_utf8_1 = UT_UTF8String_sprintf("h1 id=\"AbiTOC%d__\"", m_heading_count); - m_heading_count++; - } -@@ -2319,7 +2319,7 @@ - tagPending = true; - bClassAsTag = true; - -- if (m_toc) { -+ if (m_toc->docHasTOC()) { - m_utf8_1 = UT_UTF8String_sprintf("h2 id=\"AbiTOC%d__\"", m_heading_count); - m_heading_count++; - } -@@ -2337,7 +2337,7 @@ - tagPending = true; - bClassAsTag = true; - -- if (m_toc) { -+ if (m_toc->docHasTOC()) { - m_utf8_1 = UT_UTF8String_sprintf("h3 id=\"AbiTOC%d__\"", m_heading_count); - m_heading_count++; - } -@@ -2398,7 +2398,7 @@ - tagPending = true; - bClassAsTag = true; - -- if (m_toc) { -+ if (m_toc->docHasTOC()) { - m_utf8_1 = UT_UTF8String_sprintf("h1 id=\"AbiTOC%d__\"", m_heading_count); - m_heading_count++; - } else { -@@ -2412,7 +2412,7 @@ - tagPending = true; - bClassAsTag = true; - -- if (m_toc) { -+ if (m_toc->docHasTOC()) { - m_utf8_1 = UT_UTF8String_sprintf("h2 id=\"AbiTOC%d__\"", m_heading_count); - m_heading_count++; - } else { -@@ -2426,7 +2426,7 @@ - tagPending = true; - bClassAsTag = true; - -- if (m_toc) { -+ if (m_toc->docHasTOC()) { - m_utf8_1 = UT_UTF8String_sprintf("h3 id=\"AbiTOC%d__\"", m_heading_count); - m_heading_count++; - } else { -@@ -2455,7 +2455,7 @@ - tagID = TT_P; - tagPending = true; - -- if (m_toc && m_toc->isTOCStyle(szValue)) { -+ if (m_toc->docHasTOC() && m_toc->isTOCStyle(szValue)) { - m_utf8_1 = UT_UTF8String_sprintf("p id=\"AbiTOC%d__\"", m_heading_count); - m_heading_count++; - } else { -@@ -2468,7 +2468,7 @@ - tagID = TT_P; - tagPending = true; - -- if (m_toc && m_toc->isTOCStyle(szValue)) { -+ if (m_toc->docHasTOC() && m_toc->isTOCStyle(szValue)) { - m_utf8_1 = UT_UTF8String_sprintf("p id=\"AbiTOC%d__\"", m_heading_count); - m_heading_count++; - } else { -@@ -6132,7 +6132,9 @@ - UT_UTF8String selector("*."); - if (m_class_name.byteLength ()) - { -- selector += m_class_name; -+ UT_UTF8String tmp = m_class_name; -+ tmp.escapeXML(); -+ selector += tmp.utf8_str(); - } - else - { -diff -urNad abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_exp_HTML.cpp.orig abiword-2.6.2/abiword/src/wp/impexp/xp/ie_exp_HTML.cpp.orig ---- abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_exp_HTML.cpp.orig 1970-01-01 01:00:00.000000000 +0100 -+++ abiword-2.6.2/abiword/src/wp/impexp/xp/ie_exp_HTML.cpp.orig 2008-04-17 21:45:40.000000000 +0200 -@@ -0,0 +1,7145 @@ -+/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ -+ -+/* AbiWord -+ * Copyright (C) 2007 Hubert Figuiere -+ * Copyright (C) 2003-2005 Mark Gilbert -+ * Copyright (C) 2002,2004 Francis James Franklin -+ * Copyright (C) 2001-2002 AbiSource, Inc. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version 2 -+ * of the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -+ * 02111-1307, USA. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "ut_locale.h" -+#include "ut_debugmsg.h" -+#include "ut_assert.h" -+#include "ut_exception.h" -+#include "ut_string.h" -+#include "ut_bytebuf.h" -+#include "ut_base64.h" -+#include "ut_hash.h" -+#include "ut_units.h" -+#include "ut_wctomb.h" -+#include "ut_path.h" -+#include "ut_math.h" -+#include "ut_misc.h" -+#include "ut_string_class.h" -+#include "ut_png.h" -+ -+#include "xap_App.h" -+#include "xap_EncodingManager.h" -+ -+#include "pt_Types.h" -+#include "pl_Listener.h" -+#include "pd_Document.h" -+#include "pd_Style.h" -+#include "pp_AttrProp.h" -+#include "pp_Property.h" -+#include "pp_PropertyMap.h" -+#include "px_ChangeRecord.h" -+#include "px_CR_Object.h" -+#include "px_CR_Span.h" -+#include "px_CR_Strux.h" -+#include "ut_mbtowc.h" -+#include "xap_Frame.h" -+#include "xav_View.h" -+#include "gr_Graphics.h" -+ -+#include "fd_Field.h" -+ -+#include "fl_AutoNum.h" -+ -+#include "ie_types.h" -+#include "ie_TOC.h" -+#include "ie_impexp_HTML.h" -+#include "ie_exp_HTML.h" -+#include "ap_Strings.h" -+ -+#ifdef HTML_DIALOG_OPTIONS -+#include "xap_Dialog_Id.h" -+#include "xap_DialogFactory.h" -+#endif -+ -+#ifdef HTML_TABLES_SUPPORTED -+#include "ie_Table.h" -+#endif -+ -+#define MYEOL "\n" -+#define MAX_LINE_LEN 200 -+ -+/*****************************************************************/ -+/*****************************************************************/ -+ -+IE_Exp_HTML_Sniffer::IE_Exp_HTML_Sniffer () -+#ifdef HTML_NAMED_CONSTRUCTORS -+ : IE_ExpSniffer(IE_IMPEXPNAME_XHTML, true) -+#endif -+{ -+ // -+} -+ -+bool IE_Exp_HTML_Sniffer::recognizeSuffix (const char * szSuffix) -+{ -+ return (!g_ascii_strcasecmp (szSuffix, ".xhtml") || -+ !(g_ascii_strcasecmp (szSuffix, ".html")) || -+ !(g_ascii_strcasecmp (szSuffix, ".htm"))); -+} -+ -+UT_Error IE_Exp_HTML_Sniffer::constructExporter (PD_Document * pDocument, -+ IE_Exp ** ppie) -+{ -+ IE_Exp_HTML * p = new IE_Exp_HTML(pDocument); -+ *ppie = p; -+ return UT_OK; -+} -+ -+bool IE_Exp_HTML_Sniffer::getDlgLabels (const char ** pszDesc, -+ const char ** pszSuffixList, -+ IEFileType * ft) -+{ -+ *pszDesc = "HTML/XHTML (.html)"; -+ *pszSuffixList = "*.html"; -+ *ft = getFileType (); -+ return true; -+} -+ -+UT_Confidence_t IE_Exp_HTML_Sniffer::supportsMIME (const char * szMimeType) -+{ -+ if(!strcmp(szMimeType, IE_MIMETYPE_XHTML) || -+ !strcmp(szMimeType, "application/xhtml") || -+ !strcmp(szMimeType, "text/html")) -+ return UT_CONFIDENCE_PERFECT; -+ return UT_CONFIDENCE_ZILCH; -+} -+ -+#ifdef HTML_ENABLE_HTML4 -+ -+// HTML 4 -+ -+IE_Exp_HTML4_Sniffer::IE_Exp_HTML4_Sniffer () -+#ifdef HTML_NAMED_CONSTRUCTORS -+ : IE_ExpSniffer(IE_IMPEXPNAME_HTML, true) -+#endif -+{ -+ // -+} -+ -+bool IE_Exp_HTML4_Sniffer::recognizeSuffix (const char * szSuffix) -+{ -+ return (!(g_ascii_strcasecmp (szSuffix, ".html")) || !(g_ascii_strcasecmp (szSuffix, ".htm"))); -+} -+ -+UT_Error IE_Exp_HTML4_Sniffer::constructExporter (PD_Document * pDocument, -+ IE_Exp ** ppie) -+{ -+ IE_Exp_HTML * p = new IE_Exp_HTML(pDocument); -+ if (p) p->set_HTML4 (); -+ *ppie = p; -+ return UT_OK; -+} -+ -+bool IE_Exp_HTML4_Sniffer::getDlgLabels (const char ** pszDesc, -+ const char ** pszSuffixList, -+ IEFileType * ft) -+{ -+ *pszDesc = "HTML 4.0 (.html, .htm)"; -+ *pszSuffixList = "*.html; *.htm"; -+ *ft = getFileType (); -+ return true; -+} -+ -+UT_Confidence_t IE_Exp_HTML4_Sniffer::supportsMIME (const char * szMimeType) -+{ -+ if(!strcmp(szMimeType, "text/html")) -+ return UT_CONFIDENCE_PERFECT; -+ return UT_CONFIDENCE_ZILCH; -+} -+ -+#endif /* HTML_ENABLE_HTML4 */ -+ -+#ifdef HTML_ENABLE_PHTML -+ -+// XHTML w/ PHP instructions for AbiWord Web Docs -+ -+IE_Exp_PHTML_Sniffer::IE_Exp_PHTML_Sniffer () -+#ifdef HTML_NAMED_CONSTRUCTORS -+ : IE_ExpSniffer(IE_IMPEXPNAME_PHTML, false) -+#endif -+{ -+ // -+} -+ -+bool IE_Exp_PHTML_Sniffer::recognizeSuffix (const char * szSuffix) -+{ -+ return (!(g_ascii_strcasecmp (szSuffix, ".phtml"))); -+} -+ -+UT_Error IE_Exp_PHTML_Sniffer::constructExporter (PD_Document * pDocument, -+ IE_Exp ** ppie) -+{ -+ IE_Exp_HTML * p = new IE_Exp_HTML(pDocument); -+ if (p) p->set_PHTML (); -+ *ppie = p; -+ return UT_OK; -+} -+ -+bool IE_Exp_PHTML_Sniffer::getDlgLabels(const char ** pszDesc, -+ const char ** pszSuffixList, -+ IEFileType * ft) -+{ -+ *pszDesc = "XHTML+PHP (.phtml)"; -+ *pszSuffixList = "*.phtml"; -+ *ft = getFileType(); -+ return true; -+} -+ -+#endif /* HTML_ENABLE_PHTML */ -+ -+#ifdef HTML_ENABLE_MHTML -+ -+// Multipart HTML: http://www.rfc-editor.org/rfc/rfc2557.txt -+ -+IE_Exp_MHTML_Sniffer::IE_Exp_MHTML_Sniffer () -+#ifdef HTML_NAMED_CONSTRUCTORS -+ : IE_ExpSniffer(IE_IMPEXPNAME_MHTML, true) -+#endif -+{ -+ // -+} -+ -+bool IE_Exp_MHTML_Sniffer::recognizeSuffix (const char * szSuffix) -+{ -+ return (!(g_ascii_strcasecmp (szSuffix, ".mht"))); -+} -+ -+UT_Error IE_Exp_MHTML_Sniffer::constructExporter (PD_Document * pDocument, -+ IE_Exp ** ppie) -+{ -+ IE_Exp_HTML * p = new IE_Exp_HTML(pDocument); -+ if (p) p->set_MHTML (); -+ *ppie = p; -+ return UT_OK; -+} -+ -+bool IE_Exp_MHTML_Sniffer::getDlgLabels(const char ** pszDesc, -+ const char ** pszSuffixList, -+ IEFileType * ft) -+{ -+ *pszDesc = "Multipart HTML (.mht)"; -+ *pszSuffixList = "*.mht"; -+ *ft = getFileType(); -+ return true; -+} -+ -+#endif /* HTML_ENABLE_MHTML */ -+ -+/*****************************************************************/ -+/*****************************************************************/ -+ -+/* TODO: is there a better way to do this? -+ */ -+static UT_UTF8String s_string_to_url (const UT_String & str) -+{ -+ UT_UTF8String url; -+ -+ static const char hex[16] = { -+ '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' -+ }; -+ char buf[4]; -+ buf[0] = '%'; -+ buf[3] = 0; -+ -+ const char * ptr = str.c_str (); -+ while (*ptr) -+ { -+ bool isValidPunctuation = false; -+ switch (*ptr) -+ { -+ case '-': // TODO: any others? -+ case '_': -+ case '.': -+ isValidPunctuation = true; -+ break; -+ default: -+ break; -+ } -+ unsigned char u = (unsigned char) *ptr; -+ if (!isalnum (static_cast(u)) && !isValidPunctuation) -+ { -+ buf[1] = hex[(u >> 4) & 0x0f]; -+ buf[2] = hex[ u & 0x0f]; -+ url += buf; -+ } -+ else -+ { -+ buf[2] = (char) *ptr; -+ url += (buf + 2); -+ } -+ ptr++; -+ } -+ return url; -+} -+ -+static UT_UTF8String s_string_to_url (const UT_UTF8String & str) -+{ -+ UT_String s(str.utf8_str()); -+ return s_string_to_url(s); -+} -+ -+static const char * s_prop_list[] = { -+ "background-color", "transparent", -+ "color", "", -+ "font-family", "", -+ "font-size", "medium", -+ "font-style", "normal", -+ "font-variant", "normal", -+ "font-weight", "normal", -+ "height", "auto", -+ "margin-bottom", "0pt", -+ "margin-left", "0pt", -+ "margin-right", "0pt", -+ "margin-top", "0pt", -+ "orphans", "2", -+ "text-align", "", -+ "text-decoration", "none", -+ "text-indent", "0in", -+ "vertical-align", "baseline", -+ "widows", "2", -+ "width", "auto", -+ 0, 0 -+}; -+static const UT_uint32 s_PropListLen = G_N_ELEMENTS(s_prop_list) - 2; /* don't include the zeros */ -+ -+/*! This function returns true if the given property is a valid CSS -+ property. It is based on the list in pp_Property.cpp, and, as such, -+ is quite brittle. -+ -+ prop_default may be zero on return, indicating that the default is not fixed -+*/ -+static bool is_CSS (const char * prop_name, const char ** prop_default = 0) -+{ -+ if ( prop_name == 0) return false; -+ if (*prop_name == 0) return false; -+ -+ bool bCSS = false; -+ -+ for (UT_uint32 i = 0; i < s_PropListLen; i += 2) -+ if (!strcmp (prop_name, s_prop_list[i])) -+ { -+ if (prop_default) *prop_default = s_prop_list[i+1]; -+ bCSS = true; -+ break; -+ } -+ return bCSS; -+} -+ -+/*! This function copies a string to a new string, removing all the white -+ space in the process. -+*/ -+static char * s_removeWhiteSpace (const char * text, UT_UTF8String & utf8str, -+ bool bLowerCase = true) -+{ -+ utf8str = ""; -+ -+ if (text) -+ { -+ char buf[2]; // ick! [TODO ??] -+ buf[1] = 0; -+ const char * ptr = text; -+ while (*ptr) -+ { -+ if (isspace ((int) ((unsigned char) *ptr))) -+ { -+ buf[0] = '_'; -+ } -+ else -+ { -+ buf[0] = *ptr; -+ } -+ utf8str += buf; -+ ptr++; -+ } -+ -+ if(bLowerCase) -+ utf8str.lowerCase(); -+ } -+ return 0; -+} -+ -+/*****************************************************************/ -+/*****************************************************************/ -+ -+#define IS_TRANSPARENT_COLOR(c) (!strcmp(c, "transparent")) -+ -+#define BT_NORMAL 1 -+#define BT_HEADING1 2 -+#define BT_HEADING2 3 -+#define BT_HEADING3 4 -+#define BT_BLOCKTEXT 5 -+#define BT_PLAINTEXT 6 -+#define BT_NUMBEREDLIST 7 -+#define BT_BULLETLIST 8 -+ -+class s_HTML_Listener; -+class s_HTML_HdrFtr_Listener; -+ -+bool m_bSecondPass = false; -+bool m_bInAFENote = false; -+ -+class s_StyleTree : public PL_Listener -+{ -+private: -+ PD_Document * m_pDocument; // root element of tree only (atm, anyway) -+ -+ s_StyleTree * m_parent; -+ s_StyleTree ** m_list; -+ -+ UT_uint32 m_count; -+ UT_uint32 m_max; -+ -+ bool m_bInUse; -+ -+ UT_UTF8String m_style_name; -+ UT_UTF8String m_class_name; -+ UT_UTF8String m_class_list; -+ -+ PD_Style * m_style; -+ -+ typedef std::map map_type; -+ map_type m_map; -+ -+ s_StyleTree (s_StyleTree * parent, const char * name, PD_Style * style); -+public: -+ s_StyleTree (PD_Document * pDocument); -+ ~s_StyleTree (); -+ -+private: -+ bool add (const char * style_name, PD_Style * style); -+public: -+ bool add (const char * style_name, PD_Document * pDoc); -+ -+private: -+ void inUse (); -+public: -+ const s_StyleTree * findAndUse (const char * style_name); -+ -+ const s_StyleTree * find (const char * style_name) const; -+ const s_StyleTree * find (PD_Style * style) const; -+ -+ bool descends (const char * style_name) const; -+ -+ void print (s_HTML_Listener * listener) const; -+ -+ const s_StyleTree * operator[] (UT_uint32 i) const -+ { -+ return (i < m_count) ? m_list[i] : 0; -+ } -+ UT_uint32 count () const { return m_count; } -+ -+ const UT_UTF8String & style_name () const { return m_style_name; } -+ const UT_UTF8String & class_name () const { return m_class_name; } -+ const UT_UTF8String & class_list () const { return m_class_list; } -+ -+ const std::string & lookup (const std::string & prop_name) const; -+ -+private: -+ void styleCheck (PT_AttrPropIndex api); -+public: -+ /* implementation of PL_Listener -+ */ -+ bool populate (PL_StruxFmtHandle sfh, -+ const PX_ChangeRecord * pcr); -+ -+ bool populateStrux (PL_StruxDocHandle sdh, -+ const PX_ChangeRecord * pcr, -+ PL_StruxFmtHandle * psfh); -+ -+ bool change (PL_StruxFmtHandle sfh, -+ const PX_ChangeRecord * pcr); -+ -+ bool insertStrux (PL_StruxFmtHandle sfh, -+ const PX_ChangeRecord * pcr, -+ PL_StruxDocHandle sdh, -+ PL_ListenerId lid, -+ void (*pfnBindHandles) (PL_StruxDocHandle sdhNew, -+ PL_ListenerId lid, -+ PL_StruxFmtHandle sfhNew)); -+ -+ bool signal (UT_uint32 iSignal); -+}; -+ -+class s_HTML_Listener : public PL_Listener -+{ -+ friend class s_HTML_HdrFtr_Listener; -+public: -+ s_HTML_Listener (PD_Document * pDocument, IE_Exp_HTML * pie, bool bClipBoard, -+ bool bTemplateBody, const XAP_Exp_HTMLOptions * exp_opt, -+ s_StyleTree * style_tree, -+ UT_UTF8String & linkCSS, -+ UT_UTF8String & title); -+ -+ ~s_HTML_Listener (); -+ -+ bool populate (PL_StruxFmtHandle sfh, -+ const PX_ChangeRecord * pcr); -+ -+ bool populateStrux (PL_StruxDocHandle sdh, -+ const PX_ChangeRecord * pcr, -+ PL_StruxFmtHandle * psfh); -+ -+ //bool startOfDocument (); // Unused -+ bool endOfDocument (); -+ -+ bool change (PL_StruxFmtHandle sfh, -+ const PX_ChangeRecord * pcr); -+ -+ bool insertStrux (PL_StruxFmtHandle sfh, -+ const PX_ChangeRecord * pcr, -+ PL_StruxDocHandle sdh, -+ PL_ListenerId lid, -+ void (*pfnBindHandles) (PL_StruxDocHandle sdhNew, -+ PL_ListenerId lid, -+ PL_StruxFmtHandle sfhNew)); -+ -+ bool signal (UT_uint32 iSignal); -+ void startEmbeddedStrux(void); -+ -+private: -+ void _outputBegin (PT_AttrPropIndex api); -+ void _outputEnd (); -+ bool _openStyleSheet (UT_UTF8String & css_path); -+ void _closeStyleSheet (); -+ void _outputStyles (const PP_AttrProp * pAP); -+ void _openSection (PT_AttrPropIndex api, UT_uint16 iSectionSpecialType); -+ void _closeSection (void); -+ -+ void _openTag (PT_AttrPropIndex api, PL_StruxDocHandle sdh); -+ void _closeTag (void); -+ void _closeSpan (void); -+ void _openSpan (PT_AttrPropIndex api); -+ -+ void _popUnendedStructures(void); -+ -+#ifdef HTML_TABLES_SUPPORTED -+ void _openTable (PT_AttrPropIndex api); -+ void _closeTable (); -+ void _openRow (PT_AttrPropIndex api); -+ void _openCell (PT_AttrPropIndex api); -+ void _closeCell (); -+#endif -+ -+ void _openTextBox (PT_AttrPropIndex api); -+ void _openPosImage (PT_AttrPropIndex api); -+ void _closeTextBox (); -+ -+ void _outputData (const UT_UCSChar * p, UT_uint32 length); -+ bool _inherits (const char * style, const char * from); -+ void _storeStyles (void); -+ void _populateHeaderStyle (); -+ void _populateFooterStyle (); -+ -+ void _writeImage (const UT_ByteBuf * pByteBuf, -+ const UT_UTF8String & imagedir, const UT_UTF8String & filename); -+ void _writeImageBase64 (const UT_ByteBuf * pByteBuf); -+ void _handleImage (PT_AttrPropIndex api); -+ void _handleImage (const PP_AttrProp * pAP, const char * szDataID, bool isPositioned); -+ void _handlePendingImages (); -+ void _handleField (const PX_ChangeRecord_Object * pcro, PT_AttrPropIndex api); -+ void _handleHyperlink (PT_AttrPropIndex api); -+ void _handleBookmark (PT_AttrPropIndex api); -+ void _handleMath (PT_AttrPropIndex api); -+ void _handleEmbedded (PT_AttrPropIndex api); -+ -+#ifdef HTML_META_SUPPORTED -+ void _handleMetaTag (const char * key, UT_UTF8String & value); -+ void _handleMeta (); -+#endif -+ -+ void _doEndnotes (); -+ void _doFootnotes (); -+ void _emitTOC (PT_AttrPropIndex api); -+ -+ PD_Document * m_pDocument; -+ PT_AttrPropIndex m_apiLastSpan; -+ IE_Exp_HTML * m_pie; -+ bool m_bClipBoard; -+ bool m_bTemplateBody; -+ const XAP_Exp_HTMLOptions * m_exp_opt; -+ s_StyleTree * m_style_tree; -+ -+ inline bool get_HTML4 () const { return m_exp_opt->bIs4; } -+ inline bool get_PHTML () const { return m_exp_opt->bIsAbiWebDoc; } -+ inline bool get_Declare_XML () const { return m_exp_opt->bDeclareXML && !m_exp_opt->bIs4; } -+ inline bool get_Allow_AWML () const { return m_exp_opt->bAllowAWML && !m_exp_opt->bIs4; } -+ inline bool get_Embed_CSS () const { return m_exp_opt->bEmbedCSS; } -+ inline bool get_Link_CSS () const { return m_exp_opt->bLinkCSS; } -+ inline bool get_Abs_Units () const { return m_exp_opt->bAbsUnits; } -+ inline bool get_Scale_Units () const { return m_exp_opt->bScaleUnits; } -+ inline UT_uint32 get_Compact () const { return m_exp_opt->iCompact; } -+ inline bool get_Embed_Images () const { return m_exp_opt->bEmbedImages; } -+ inline bool get_Multipart () const { return m_exp_opt->bMultipart; } -+ inline bool get_Class_Only() const { return m_exp_opt->bClassOnly; } -+ -+ bool m_bInSection; -+ bool m_bInFrame; -+ bool m_bInTextBox; // Necessary? Possibly not. Convenient and safe? Yes. -+ bool m_bInTOC; -+ bool m_bInBlock; -+ bool m_bInSpan; -+ bool m_bNextIsSpace; -+ bool m_bWroteText; -+ bool m_bFirstWrite; -+ bool m_bQuotedPrintable; -+ bool m_bHaveHeader; -+ bool m_bHaveFooter; -+ -+#ifdef HTML_TABLES_SUPPORTED -+ ie_Table m_TableHelper; -+#endif -+ -+ // Need to look up proper type, and place to stick #defines... -+ -+ UT_uint32 m_iBlockType; // BT_* -+ UT_uint32 m_iListDepth; // 0 corresponds to not in a list -+ UT_NumberStack m_utsListType; -+ UT_uint32 m_iImgCnt; -+ UT_Wctomb m_wmctomb; -+ -+ enum WhiteSpace -+ { -+ ws_None = 0, -+ ws_Pre = 1, -+ ws_Post = 2, -+ ws_Both = 3 -+ }; -+ -+ /* low-level; these may use m_utf8_0 but not m_utf8_1 -+ * WARNING: Use of purely tag-operative methods (tagOpen,tagClose,etc..) may circumvent -+ * important checks and preparations done in strux-operative methods (_open*,_close*,etc...) -+ * and thus these should only be used by likewise low-level code. -+ */ -+ void tagRaw (UT_UTF8String & content); -+ UT_uint32 tagIndent (); -+ void tagNewIndent (UT_UTF8String & utf8, UT_uint32 depth); -+ void tagNewIndent (UT_uint32 extra = 0); -+ void tagOpenClose (const UT_UTF8String & content, bool suppress, -+ WhiteSpace ws = ws_Both); -+ void tagOpen (UT_uint32 tagID, const UT_UTF8String & content, -+ WhiteSpace ws = ws_Both); -+ void tagClose (UT_uint32 tagID, const UT_UTF8String & content, -+ WhiteSpace ws = ws_Both); -+ void tagClose (UT_uint32 tagID); -+ void tagOpenBroken (const UT_UTF8String & content, -+ WhiteSpace ws = ws_Pre); -+ void tagCloseBroken (const UT_UTF8String & content, bool suppress, -+ WhiteSpace ws = ws_Post); -+ UT_uint32 tagTop (); -+ void tagPop (); -+ void tagPI (const char * target, const UT_UTF8String & content); -+ void tagComment (const UT_UTF8String & content); -+ void tagCommentOpen (); -+ void tagCommentClose (); -+ void styleIndent (); -+ -+public: -+ void styleOpen (const UT_UTF8String & rule); -+ void styleClose (); -+ void styleNameValue (const char * name, const UT_UTF8String & value); -+ void setHaveHeader(); -+ void setHaveFooter(); -+private: -+ void styleText (const UT_UTF8String & content); -+ void textTrusted (const UT_UTF8String & text); -+ void textUntrusted (const char * text); -+ -+ void multiHeader (const UT_UTF8String & title); -+ void multiBoundary (bool end = false); -+ void multiField (const char * name, const UT_UTF8String & value); -+ void multiBreak (); -+ -+ UT_uint32 listDepth (); -+ UT_uint32 listType (); -+ void listPush (UT_uint32 type, const char * ClassName); -+ void listPop (); -+ void listPopToDepth (UT_uint32 depth); -+ -+ bool compareStyle (const char * key, const char * value); -+ void _fillColWidthsVector(); -+ void _setCellWidthInches(void); -+ -+ void addFootnote(PD_DocumentRange * pDocRange); -+ void addEndnote(PD_DocumentRange * pDocRange); -+ UT_uint32 getNumFootnotes(void); -+ UT_uint32 getNumEndnotes(void); -+ -+ /* temporary strings; use with extreme caution -+ */ -+ UT_UTF8String m_utf8_0; // low-level -+ UT_UTF8String m_utf8_1; // intermediate -+ -+ UT_UTF8String m_utf8_span; // span tag-string cache -+ UT_UTF8String m_utf8_style; // current block style -+ -+ const s_StyleTree * m_StyleTreeInline; // current inline style tree, if any -+ const s_StyleTree * m_StyleTreeBlock; // current block style tree, if any -+ const s_StyleTree * m_StyleTreeBody; // document default style tree, if any -+ -+ const PP_AttrProp * m_pAPStyles; -+ -+ UT_UTF8String m_utf8_css_path; // Multipart HTML: cache for content location -+ -+ UT_NumberStack m_tagStack; -+ -+ UT_uint32 m_styleIndent; -+ -+ GsfOutput * m_fdCSS; -+ -+ UT_GenericStringMap m_SavedURLs; -+ -+ bool m_bIgnoreTillEnd; -+ bool m_bIgnoreTillNextSection; -+ PT_DocPosition m_iEmbedStartPos; -+ -+ double m_dPageWidthInches; -+ double m_dSecLeftMarginInches; -+ double m_dSecRightMarginInches; -+ double m_dSecTopMarginInches; -+ double m_dSecBottomMarginInches; -+ double m_dCellWidthInches; -+ UT_GenericVector m_vecDWidths; -+ UT_UTF8String & m_sLinkCSS; -+ UT_UTF8String & m_sTitle; -+ -+ UT_uint32 m_iOutputLen; -+ bool m_bCellHasData; -+ UT_GenericVector m_vecFootnotes; -+ UT_GenericVector m_vecEndnotes; -+ -+ IE_TOCHelper * m_toc; -+ int m_heading_count; -+}; -+ -+class s_HTML_HdrFtr_Listener : public PL_Listener -+{ -+ friend class s_HTML_Listener; -+public: -+ s_HTML_HdrFtr_Listener (PD_Document * pDocument, IE_Exp_HTML * pie, PL_Listener * pHTML_Listener); -+ -+ ~s_HTML_HdrFtr_Listener (); -+ -+ bool populate (PL_StruxFmtHandle sfh, -+ const PX_ChangeRecord * pcr); -+ -+ bool populateStrux (PL_StruxDocHandle sdh, -+ const PX_ChangeRecord * pcr, -+ PL_StruxFmtHandle * psfh); -+ -+ //See note in _writeDocument -+ //bool startOfDocument (); -+ bool endOfDocument (); -+ -+ bool change (PL_StruxFmtHandle sfh, -+ const PX_ChangeRecord * pcr); -+ -+ bool insertStrux (PL_StruxFmtHandle sfh, -+ const PX_ChangeRecord * pcr, -+ PL_StruxDocHandle sdh, -+ PL_ListenerId lid, -+ void (*pfnBindHandles) (PL_StruxDocHandle sdhNew, -+ PL_ListenerId lid, -+ PL_StruxFmtHandle sfhNew)); -+ -+ bool signal (UT_uint32 iSignal); -+ void doHdrFtr(bool bHeader); -+private: -+ PD_DocumentRange * m_pHdrDocRange; -+ PD_DocumentRange * m_pFtrDocRange; -+ PD_Document * m_pDocument; -+ PL_Listener * m_pHTML_Listener; -+}; -+ -+/*****************************************************************/ -+/*****************************************************************/ -+ -+bool s_HTML_Listener::compareStyle (const char * key, const char * value) -+{ -+ /* require both key & value to be non-empty strings -+ */ -+ if (( key == 0) || ( value == 0)) return false; -+ if ((*key == 0) || (*value == 0)) return false; -+ -+ std::string css_name(key); -+ -+ std::string css_value; -+ -+ if (m_StyleTreeInline) -+ css_value = m_StyleTreeInline->lookup (css_name); -+ if (m_StyleTreeBlock && css_value.empty()) -+ css_value = m_StyleTreeBlock->lookup (css_name); -+ if (m_StyleTreeBody && css_value.empty()) -+ css_value = m_StyleTreeBody->lookup (css_name); -+ -+ return (css_value == value); -+} -+ -+void s_HTML_Listener::tagRaw (UT_UTF8String & content) -+{ -+#ifdef HTML_ENABLE_MHTML -+ if (m_bQuotedPrintable) content.escapeMIME (); -+#endif -+ // fputs (content.utf8_str (), stdout); -+ m_pie->write (content.utf8_str (), content.byteLength ()); -+ m_iOutputLen += content.byteLength(); -+} -+ -+UT_uint32 s_HTML_Listener::tagIndent () -+{ -+ return m_tagStack.getDepth (); -+} -+ -+void s_HTML_Listener::tagNewIndent (UT_UTF8String & utf8, UT_uint32 depth) -+{ -+ UT_uint32 i; -+ -+ for (i = 0; i < (depth >> 3); i++) utf8 += "\t"; -+ for (i = 0; i < (depth & 7); i++) utf8 += " "; -+} -+ -+void s_HTML_Listener::tagNewIndent (UT_uint32 extra) -+{ -+ m_utf8_0 = ""; -+ -+ if(get_Compact()) -+ return; -+ -+ tagNewIndent (m_utf8_0, m_tagStack.getDepth () + extra); -+} -+ -+/* NOTE: We terminate each line with a \r\n sequence to make IE think -+ * that our XHTML is really HTML. This is a stupid IE bug. -+ * Sorry. -+ */ -+ -+void s_HTML_Listener::tagOpenClose (const UT_UTF8String & content, bool suppress, -+ WhiteSpace ws) -+{ -+ if (ws & ws_Pre) -+ tagNewIndent (); -+ else -+ m_utf8_0 = ""; -+ -+ m_utf8_0 += "<"; -+ m_utf8_0 += content; -+ if (suppress) -+ m_utf8_0 += ">"; -+ else -+ m_utf8_0 += " />"; -+ -+ if (ws & ws_Post && !get_Compact()) m_utf8_0 += MYEOL; -+ -+ if(get_Compact()) -+ { -+ if(m_iOutputLen + m_utf8_0.byteLength() > get_Compact()) -+ { -+ m_pie->write(MYEOL, strlen(MYEOL)); -+ m_iOutputLen = 0; -+ } -+ } -+ -+ tagRaw (m_utf8_0); -+} -+ -+void s_HTML_Listener::tagOpen (UT_uint32 tagID, const UT_UTF8String & content, -+ WhiteSpace ws) -+{ -+ if (ws & ws_Pre) -+ tagNewIndent (); -+ else -+ m_utf8_0 = ""; -+ -+ m_utf8_0 += "<"; -+ m_utf8_0 += content; -+ m_utf8_0 += ">"; -+ -+ if (ws & ws_Post && !get_Compact()) m_utf8_0 += MYEOL; -+ -+ tagRaw (m_utf8_0); -+ -+ m_tagStack.push (tagID); -+} -+ -+void s_HTML_Listener::tagClose (UT_uint32 tagID, const UT_UTF8String & content, -+ WhiteSpace ws) -+{ -+ tagClose (tagID); -+ -+ if (ws & ws_Pre) -+ tagNewIndent (); -+ else -+ m_utf8_0 = ""; -+ -+ m_utf8_0 += ""; -+ -+ if (ws & ws_Post && !get_Compact()) m_utf8_0 += MYEOL; -+ -+ if(get_Compact()) -+ { -+ if(m_iOutputLen + m_utf8_0.byteLength() > get_Compact()) -+ { -+ m_pie->write(MYEOL, strlen(MYEOL)); -+ m_iOutputLen = 0; -+ } -+ } -+ -+ tagRaw (m_utf8_0); -+} -+ -+void s_HTML_Listener::tagClose (UT_uint32 tagID) -+{ -+ UT_uint32 i = 0; -+ m_tagStack.pop ((UT_sint32*)&i); -+ -+ if (i == tagID) return; -+ -+ UT_DEBUGMSG(("WARNING: possible tag mis-match in XHTML output!\n")); -+ UT_DEBUGMSG(("WARNING: Tag requested %i, tag found %i\n", tagID, i)); -+} -+ -+/* use with *extreme* caution! (this is used by images with data-URLs) -+ */ -+void s_HTML_Listener::tagOpenBroken (const UT_UTF8String & content, -+ WhiteSpace ws) -+{ -+ if (ws & ws_Pre) -+ { -+ tagNewIndent (); -+ m_utf8_0 += "<"; -+ } -+ else -+ m_utf8_0 = "<"; -+ -+ m_utf8_0 += content; -+ -+ tagRaw (m_utf8_0); -+} -+ -+/* use with *extreme* caution! (this is used by images with data-URLs) -+ */ -+void s_HTML_Listener::tagCloseBroken (const UT_UTF8String & content, bool suppress, -+ WhiteSpace ws) -+{ -+ m_utf8_0 = content; -+ -+ if (suppress) -+ m_utf8_0 += " >"; -+ else -+ m_utf8_0 += " />"; -+ -+ if (ws & ws_Post && !get_Compact()) -+ m_utf8_0 += MYEOL; -+ -+ if(get_Compact()) -+ { -+ if(m_iOutputLen + m_utf8_0.byteLength() > get_Compact()) -+ { -+ m_pie->write(MYEOL, strlen(MYEOL)); -+ m_iOutputLen = 0; -+ } -+ } -+ -+ tagRaw (m_utf8_0); -+} -+ -+UT_uint32 s_HTML_Listener::tagTop () -+{ -+ UT_sint32 i = 0; -+ if (m_tagStack.viewTop (i)) return (UT_uint32)i; -+ return 0; -+} -+ -+void s_HTML_Listener::tagPop () -+{ -+ // Don't forget to not put tags without explicit closure in here. -+ switch (tagTop ()) -+ { -+ case TT_TD: -+ { -+ tagClose (TT_TD, "td"); -+ } -+ break; -+ case TT_TR: -+ { -+ tagClose (TT_TR, "tr"); -+ } -+ break; -+ case TT_TBODY: -+ { -+ tagClose (TT_TBODY, "tbody"); -+ } -+ break; -+ case TT_TABLE: -+ { -+ tagClose (TT_TABLE, "table"); -+ } -+ break; -+ case TT_DIV: -+ { -+ tagClose (TT_DIV, "div"); -+ } -+ break; -+ case TT_P: -+ { -+ tagClose(TT_P, "p"); -+ } -+ break; -+ case TT_H1: -+ { -+ tagClose(TT_H1, "h1"); -+ } -+ break; -+ case TT_H2: -+ { -+ tagClose(TT_H2, "h2"); -+ } -+ break; -+ case TT_H3: -+ { -+ tagClose(TT_H3, "h3"); -+ } -+ break; -+ case TT_H4: -+ { -+ tagClose(TT_H4, "h4"); -+ } -+ break; -+ case TT_SPAN: -+ { -+ tagClose (TT_SPAN, "span"); -+ } -+ break; -+ case TT_BDO: -+ { -+ tagClose (TT_BDO, "bdo"); -+ } -+ break; -+ case TT_LI: -+ { -+ tagClose (TT_LI, "li"); -+ } -+ break; -+ case TT_UL: -+ { -+ tagClose (TT_UL, "ul"); -+ } -+ break; -+ case TT_OL: -+ { -+ tagClose (TT_OL, "ol"); -+ } -+ break; -+ default: -+ { -+ UT_DEBUGMSG(("tagPop: unhandled tag closure! %d\n",tagTop())); -+ m_utf8_1 ="error - not handled"; -+ /* There has got to be a better way than this. -+ I think putting up the usual "Write error - -+ file a bug and attach this" message is preferable -+ to spitting out nonsense html. -MG */ -+ tagClose (tagTop(), m_utf8_1); // prevents hangs see 7524 -+ } -+ break; -+ } -+} -+ -+void s_HTML_Listener::tagPI (const char * target, const UT_UTF8String & content) -+{ -+ tagNewIndent (); -+ -+ m_utf8_0 += ""; -+ if(!get_Compact()) -+ m_utf8_0 += MYEOL; -+ -+ tagRaw (m_utf8_0); -+} -+ -+void s_HTML_Listener::tagComment (const UT_UTF8String & content) -+{ -+ tagNewIndent (); -+ -+ m_utf8_0 += ""; -+ if(!get_Compact()) -+ m_utf8_0 += MYEOL; -+ -+ tagRaw (m_utf8_0); -+} -+ -+void s_HTML_Listener::tagCommentOpen () -+{ -+ tagNewIndent (); -+ -+ m_utf8_0 += ""; -+ if(!get_Compact()) -+ m_utf8_0 += MYEOL; -+ -+ tagRaw (m_utf8_0); -+} -+ -+void s_HTML_Listener::styleIndent () -+{ -+ m_utf8_0 = ""; -+ -+ for (UT_uint32 i = 0; i < m_styleIndent; i++) m_utf8_0 += "\t"; -+} -+ -+void s_HTML_Listener::styleOpen (const UT_UTF8String & rule) -+{ -+ styleIndent (); -+ -+ m_utf8_0 += rule; -+ m_utf8_0 += " {"; -+ if(!get_Compact()) -+ m_utf8_0 += MYEOL; -+ -+ if (m_fdCSS) -+ gsf_output_write (m_fdCSS, m_utf8_0.byteLength (), (const guint8*)m_utf8_0.utf8_str ()); -+ else -+ tagRaw (m_utf8_0); -+ -+ m_styleIndent++; -+} -+ -+void s_HTML_Listener::styleClose () -+{ -+ if (m_styleIndent == 0) -+ { -+ UT_DEBUGMSG(("WARNING: CSS style group over-closing!\n")); -+ return; -+ } -+ m_styleIndent--; -+ -+ styleIndent (); -+ -+ m_utf8_0 += "}"; -+ if(!get_Compact()) -+ m_utf8_0 += MYEOL; -+ -+ if (m_fdCSS) -+ gsf_output_write (m_fdCSS, m_utf8_0.byteLength (), (const guint8*)m_utf8_0.utf8_str ()); -+ else -+ tagRaw (m_utf8_0); -+} -+ -+void s_HTML_Listener::styleNameValue (const char * name, const UT_UTF8String & value) -+{ -+ styleIndent (); -+ -+ m_utf8_0 += name; -+ m_utf8_0 += ":"; -+ m_utf8_0 += value; -+ m_utf8_0 += ";"; -+ if(!get_Compact()) -+ m_utf8_0 += MYEOL; -+ -+ if (m_fdCSS) -+ gsf_output_write (m_fdCSS, m_utf8_0.byteLength (), (const guint8*)m_utf8_0.utf8_str ()); -+ else -+ tagRaw (m_utf8_0); -+} -+ -+void s_HTML_Listener::styleText (const UT_UTF8String & content) -+{ -+ if (m_fdCSS) -+ gsf_output_write (m_fdCSS, content.byteLength (), (const guint8*)content.utf8_str ()); -+ else -+ { -+ m_utf8_0 = content; -+ tagRaw (m_utf8_0); -+ } -+} -+ -+void s_HTML_Listener::textTrusted (const UT_UTF8String & text) -+{ -+ if (text.byteLength ()) -+ { -+ m_utf8_0 = text; -+ tagRaw (m_utf8_0); -+ -+ m_bWroteText = true; -+ } -+} -+ -+void s_HTML_Listener::textUntrusted (const char * text) -+{ -+ if ( text == 0) return; -+ if (*text == 0) return; -+ -+ m_utf8_0 = ""; -+ -+ char buf[2]; -+ buf[1] = 0; -+ -+ const char * ptr = text; -+ while (*ptr) -+ { -+ if ((*ptr & 0x7f) == *ptr) // ASCII -+ { -+ switch (*ptr) -+ { -+ case '<': -+ m_utf8_0 += "<"; -+ break; -+ case '>': -+ m_utf8_0 += ">"; -+ break; -+ case '&': -+ m_utf8_0 += "&"; -+ break; -+ default: -+ buf[0] = *ptr; -+ m_utf8_0 += buf; -+ break; -+ } -+ } -+ /* TODO: translate non-ASCII characters -+ */ -+ ptr++; -+ } -+ if (m_utf8_0.byteLength ()) tagRaw (m_utf8_0); -+} -+ -+static const char * s_boundary = "AbiWord_multipart_boundary____________"; -+ -+void s_HTML_Listener::multiHeader (const UT_UTF8String & title) -+{ -+ m_utf8_1 = ""; -+ multiField ("From", m_utf8_1); -+ -+ multiField ("Subject", title); -+ -+ time_t tim = time (NULL); -+ struct tm * pTime = localtime (&tim); -+ char timestr[64]; -+ strftime (timestr, 63, "%a, %d %b %Y %H:%M:%S +0100", pTime); // hmm, hard-code time zone -+ timestr[63] = 0; -+ -+ m_utf8_1 = timestr; -+ multiField ("Date", m_utf8_1); -+ -+ m_utf8_1 = "1.0"; -+ multiField ("MIME-Version", m_utf8_1); -+ -+ m_utf8_1 = "multipart/related;" MYEOL "\tboundary=\""; -+ m_utf8_1 += s_boundary; -+ m_utf8_1 += "\";" MYEOL "\ttype=\""; -+ -+ if (get_HTML4 ()) -+ m_utf8_1 += IE_MIMETYPE_HTML; -+ else -+ m_utf8_1 += IE_MIMETYPE_XHTML; -+ -+ m_utf8_1 += "\""; -+ -+ multiField ("Content-Type", m_utf8_1); -+ multiBoundary (); -+ -+ if (get_HTML4 ()) -+ m_utf8_1 = IE_MIMETYPE_HTML; -+ else -+ m_utf8_1 = IE_MIMETYPE_XHTML; -+ -+ m_utf8_1 += ";charset=\"UTF-8\""; -+ -+ multiField ("Content-Type", m_utf8_1); -+ -+ m_utf8_1 = "quoted-printable"; -+ multiField ("Content-Transfer-Encoding", m_utf8_1); -+ multiBreak (); -+ -+ m_bQuotedPrintable = true; -+} -+ -+void s_HTML_Listener::multiBoundary (bool end) -+{ -+ m_utf8_0 = MYEOL "--"; -+ m_utf8_0 += s_boundary; -+ -+ if (end) -+ m_utf8_0 += "--" MYEOL; -+ else -+ m_utf8_0 += MYEOL; -+ // fputs (m_utf8_0.utf8_str (), stdout); -+ m_pie->write (m_utf8_0.utf8_str (), m_utf8_0.byteLength ()); -+ m_iOutputLen += m_utf8_0.byteLength(); -+} -+ -+void s_HTML_Listener::multiField (const char * name, const UT_UTF8String & value) -+{ -+ m_utf8_0 = name; -+ m_utf8_0 += ":"; -+ m_utf8_0 += value; -+ if(!get_Compact()) -+ m_utf8_0 += MYEOL; -+ // fputs (m_utf8_0.utf8_str (), stdout); -+ m_pie->write (m_utf8_0.utf8_str (), m_utf8_0.byteLength ()); -+ m_iOutputLen += m_utf8_0.byteLength(); -+ -+} -+ -+void s_HTML_Listener::multiBreak () -+{ -+ m_utf8_0 = MYEOL; -+ // fputs (m_utf8_0.utf8_str (), stdout); -+ m_pie->write (m_utf8_0.utf8_str (), m_utf8_0.byteLength ()); -+ m_iOutputLen += m_utf8_0.byteLength(); -+} -+ -+/* intermediate methods -+ */ -+ -+static const char * s_DTD_XHTML_AWML = "!DOCTYPE html PUBLIC \"-//ABISOURCE//DTD XHTML plus AWML 2.2//EN\" \"http://www.abisource.com/2004/xhtml-awml/xhtml-awml.mod\""; -+ -+static const char * s_DTD_XHTML = "!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\""; -+ -+static const char * s_DTD_HTML4 = "!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\""; -+ -+static const char * s_Delimiter = -+"======================================================="; -+ -+static const char * s_Header[2] = { -+ "Created by AbiWord, a free, Open Source wordprocessor. ", -+ "For more information visit http://www.abisource.com. " -+}; -+ -+static const char * s_HeaderCompact = "Created by Abiword, www.abisource.com"; -+ -+void s_HTML_Listener::_outputBegin (PT_AttrPropIndex api) -+{ -+ if (m_bTemplateBody) -+ { -+ m_bFirstWrite = false; -+ return; -+ } -+ -+ if(m_sTitle.byteLength() == 0) -+ { -+#ifdef HTML_META_SUPPORTED -+ m_pDocument->getMetaDataProp (PD_META_KEY_TITLE, m_sTitle); -+ -+ if (m_sTitle.byteLength () == 0 && m_pie->getFileName () != NULL) -+ m_sTitle = UT_basename(m_pie->getFileName ()); -+#else -+ m_sTitle = UT_basename(m_pie->getFileName ()); -+#endif -+ } -+ -+ if (get_Multipart ()) multiHeader (m_sTitle); -+ -+ /* print XML header -+ */ -+ if (!get_HTML4 ()) -+ { -+ if (get_Declare_XML ()) -+ { -+ m_utf8_1 = "version=\"1.0\" encoding=\"UTF-8\""; -+ tagPI ("xml", m_utf8_1); -+ } -+ if (get_Allow_AWML ()) -+ m_utf8_1 = s_DTD_XHTML_AWML; -+ else -+ m_utf8_1 = s_DTD_XHTML; -+ tagOpenClose (m_utf8_1, true); -+ } -+ else -+ { -+ m_utf8_1 = s_DTD_HTML4; -+ tagOpenClose (m_utf8_1, true); -+ } -+ -+ /* open root element, i.e. ; namespace it if XHTML -+ */ -+ m_utf8_1 = "html"; -+ if (!get_HTML4 ()) -+ { -+ m_utf8_1 += " xmlns=\"http://www.w3.org/1999/xhtml\""; -+ if (get_Allow_AWML ()) m_utf8_1 += " xmlns:awml=\"http://www.abisource.com/2004/xhtml-awml/\""; -+ } -+ tagOpen (TT_HTML, m_utf8_1); -+ -+ /* start section of HTML document -+ */ -+ m_utf8_1 = "head"; -+ tagOpen (TT_HEAD, m_utf8_1); -+ -+ /* print header comment -+ * we insert them that let, because IE6 expect to find root within -+ * 6 lines. -+ */ -+ if(get_Compact()) -+ { -+ m_utf8_1 = s_HeaderCompact; -+ tagComment (m_utf8_1); -+ } -+ else -+ { -+ const UT_UTF8String delimiter(s_Delimiter); -+ tagComment (delimiter); -+ for (UT_uint32 hdri = 0; hdri < G_N_ELEMENTS(s_Header); hdri++) -+ { -+ m_utf8_1 = s_Header[hdri]; -+ tagComment (m_utf8_1); -+ } -+ tagComment (delimiter); -+ } -+ -+ /* we add a meta tag describing the document's charset as UTF-8 -+ * even with XHTML because Safari and Camino fail to recognize -+ * charset. This still validate W3C. -+ */ -+ m_utf8_1 = "meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\""; -+ tagOpenClose (m_utf8_1, get_HTML4 ()); -+ -+ /* set page's title in browser -+ */ -+ m_utf8_1 = "title"; -+ tagOpen (TT_TITLE, m_utf8_1, ws_Pre); -+ -+#ifdef HTML_META_SUPPORTED -+ textTrusted (m_sTitle.escapeXML ()); // TODO: back-port this method? -+#else -+ textUntrusted (m_sTitle.utf8_str ()); -+#endif -+ -+ tagClose (TT_TITLE, m_utf8_1, ws_Post); -+ -+#ifdef HTML_META_SUPPORTED -+ /* write out our metadata properties -+ */ -+ _handleMeta (); -+#endif -+ -+ if (!get_PHTML ()) -+ { -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ -+ if (bHaveProp && pAP) -+ { -+ _outputStyles (pAP); -+ if (!get_Embed_CSS ()) m_pAPStyles = pAP; -+ } -+ } -+ -+ if (get_PHTML ()) -+ { -+ m_utf8_1 = MYEOL " include($_SERVER['DOCUMENT_ROOT'].'/x-header.php');" MYEOL " "; -+ tagPI ("php", m_utf8_1); -+ } -+ -+ /* end section of HTML document -+ */ -+ m_utf8_1 = "head"; -+ tagClose (TT_HEAD, m_utf8_1); -+ -+ /* start section of HTML document -+ */ -+ m_utf8_1 = "body"; -+ tagOpen (TT_BODY, m_utf8_1); -+ -+ if (get_PHTML ()) -+ { -+ m_utf8_1 = MYEOL " include($_SERVER['DOCUMENT_ROOT'].'/x-page-begin.php');" MYEOL " "; -+ tagPI ("php", m_utf8_1); -+ } -+ -+ m_bFirstWrite = false; -+} -+ -+void s_HTML_Listener::_outputEnd () -+{ -+ if (m_bInBlock) _closeTag (); -+ -+ while (true) -+ { -+ UT_uint32 top = tagTop (); -+ if ((top == TT_BODY) || !top) -+ break; -+ tagPop (); -+ } -+ if (m_bTemplateBody) return; -+ -+ if (get_PHTML ()) -+ { -+ m_utf8_1 = MYEOL " include($_SERVER['DOCUMENT_ROOT'].'/x-page-end.php');" MYEOL " "; -+ tagPI ("php", m_utf8_1); -+ } -+ -+ /* end section of HTML document -+ */ -+ m_utf8_1 = "body"; -+ tagClose (TT_BODY, m_utf8_1); -+ -+ /* end section of HTML document -+ */ -+ m_utf8_1 = "html"; -+ tagClose (TT_HTML, m_utf8_1); -+ -+ if (get_Multipart ()) -+ { -+ m_bQuotedPrintable = false; -+ -+ if (m_pAPStyles) -+ { -+ _outputStyles (m_pAPStyles); -+ m_bQuotedPrintable = false; -+ } -+ _handlePendingImages (); -+ -+ multiBoundary (true); -+ } -+} -+ -+bool s_HTML_Listener::_openStyleSheet (UT_UTF8String & css_relative_path) -+{ -+ UT_UTF8String cssdir(m_pie->getFileName ()); -+ cssdir += "_files"; -+ -+ UT_go_directory_create (cssdir.utf8_str(), 0750, NULL); -+ -+ UT_UTF8String css_path = cssdir; -+ css_path += "/style.css"; -+ -+ if (m_utf8_css_path.byteLength ()) // Multipart HTML: style-sheet segment -+ { -+ multiBoundary (); -+ -+ m_utf8_1 = IE_MIMETYPE_CSS; -+ m_utf8_1 += ";charset=\"UTF-8\""; -+ -+ multiField ("Content-Type", m_utf8_1); -+ multiField ("Content-Location", m_utf8_css_path); -+ -+ m_utf8_1 = "quoted-printable"; -+ multiField ("Content-Transfer-Encoding", m_utf8_1); -+ multiBreak (); -+ -+ m_bQuotedPrintable = true; -+ } -+ else if (!get_Multipart ()) -+ { -+ m_fdCSS = UT_go_file_create (css_path.utf8_str (), NULL); -+ if (m_fdCSS == NULL) return false; -+ } -+ -+ char * base_name = UT_go_basename_from_uri (m_pie->getFileName ()); -+ if (base_name) -+ css_relative_path = base_name; -+ css_relative_path += "/styles.css"; -+ g_free(base_name); -+ -+ return true; -+} -+ -+void s_HTML_Listener::_closeStyleSheet () -+{ -+ if (m_fdCSS) { -+ gsf_output_close (m_fdCSS); -+ g_object_unref (G_OBJECT (m_fdCSS)); -+ m_fdCSS = 0; -+ } -+} -+ -+// TODO: Use the styleIndent code to clean up this output -+void s_HTML_Listener::_populateHeaderStyle() { -+ const gchar * staticCSSHeaderProps [9] = {"position: relative;","width: 100%;","height: auto;", -+ "top: 0;","bottom: auto;","right: 0;","left: 0;","}",NULL}; // Static properties for headers -+ m_utf8_1 = "#header {"; // Reinitialize the variable, now to deal with the header-identified div -+ m_utf8_1 += MYEOL; -+ for(unsigned short int propIdx = 0; propIdx < 8; propIdx += 1) -+ { -+ m_utf8_1 += staticCSSHeaderProps[propIdx]; -+ m_utf8_1 += MYEOL; -+ } -+ styleText(m_utf8_1); -+} -+// TODO: Use the styleIndent code to clean up this output -+void s_HTML_Listener::_populateFooterStyle() { -+ const gchar * staticCSSFooterProps [9] = {"position: relative;","width: 100%;","height: auto;", -+ "top: auto;","bottom: 0;","right: 0;","left: 0;","}",NULL}; // Static properties for footers -+ m_utf8_1 = "#footer {"; // Reinitialize the variable, now to deal with the footer-identified div -+ m_utf8_1 += MYEOL; -+ for(unsigned short int propIdx = 0; propIdx < 8; propIdx += 1) -+ { -+ m_utf8_1 += staticCSSFooterProps[propIdx]; -+ m_utf8_1 += MYEOL; -+ } -+ styleText(m_utf8_1); -+} -+ -+void s_HTML_Listener::_outputStyles (const PP_AttrProp * pAP) -+{ -+ // make sure any unit conversions use correct locale -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ -+ /* some cascading style rules -+ */ -+ const gchar * szName = 0; -+ const gchar * szValue = 0; -+ -+ if (get_Embed_CSS ()) -+ { -+ m_utf8_1 = "style type=\"text/css\""; -+ tagOpen (TT_STYLE, m_utf8_1); -+ tagCommentOpen (); -+ } -+ else if(get_Link_CSS()) -+ { -+ m_utf8_1 = "link href=\""; -+ m_utf8_1 += m_sLinkCSS; -+ m_utf8_1 += "\" rel=\"stylesheet\" type=\"text/css\""; -+ -+ tagOpenClose (m_utf8_1, get_HTML4 ()); -+ -+ // do not export style definitions ... -+ return; -+ } -+ else -+ { -+ UT_UTF8String css_path; -+ -+ if (!_openStyleSheet (css_path)) return; -+ -+ if (!get_Multipart () || (m_utf8_css_path.byteLength () == 0)) -+ { -+ m_utf8_1 = "link href=\""; -+ m_utf8_1 += css_path; -+ m_utf8_1 += "\" rel=\"stylesheet\" type=\"text/css\""; -+ -+ tagOpenClose (m_utf8_1, get_HTML4 ()); -+ -+ if (get_Multipart ()) -+ { -+ m_utf8_css_path = css_path; -+ return; -+ } -+ } -+ -+ /* first line of style sheet is an encoding declaration -+ */ -+ m_utf8_1 = "@charset \"UTF-8\";"; -+ if(!get_Compact()) -+ m_utf8_0 += MYEOL MYEOL; -+ -+ styleText (m_utf8_1); -+ } -+ -+ // stylesheet stolen from wikipedia -+ styleText("#toc,\n" -+".toc,\n" -+".mw-warning {\n" -+" border: 1px solid #aaa;\n" -+" background-color: #f9f9f9;\n" -+" padding: 5px;\n" -+" font-size: 95%;\n" -+"}\n" -+"#toc h2,\n" -+".toc h2 {\n" -+" display: inline;\n" -+" border: none;\n" -+" padding: 0;\n" -+" font-size: 100%;\n" -+" font-weight: bold;\n" -+"}\n" -+"#toc #toctitle,\n" -+".toc #toctitle,\n" -+"#toc .toctitle,\n" -+".toc .toctitle {\n" -+" text-align: center;\n" -+"}\n" -+"#toc ul,\n" -+".toc ul {\n" -+" list-style-type: none;\n" -+" list-style-image: none;\n" -+" margin-left: 0;\n" -+" padding-left: 0;\n" -+" text-align: left;\n" -+"}\n" -+"#toc ul ul,\n" -+".toc ul ul {\n" -+" margin: 0 0 0 2em;\n" -+"}\n" -+"#toc .toctoggle,\n" -+".toc .toctoggle {\n" -+" font-size: 94%;\n" -+"}"); -+ -+ /* global page styles refer to the tag -+ */ -+ PD_Style * pStyle = 0; -+ m_pDocument->getStyle ("Normal", &pStyle); -+ -+ if (pAP && pStyle) -+ { -+ /* Add normal styles to any descendent of the body for global effect -+ * -+ * (I think @ rules are supposed to precede non-@ rules) -+ */ -+ m_utf8_1 = "@media print, projection, embossed"; -+ styleOpen (m_utf8_1); -+ -+ m_utf8_1 = "body"; -+ styleOpen (m_utf8_1); -+ -+ // Set margins for paged media to match those set in AbiWord -+ // TODO: consolidate all places of awml-css21 matching into one UT/PP function -+ const gchar * marginProps [10] = {"page-margin-top","padding-top", -+ "page-margin-bottom","padding-bottom", -+ "page-margin-left","padding-left", -+ "page-margin-right","padding-right", -+ NULL, NULL}; -+ for (unsigned short int propIdx = 0; propIdx < 8; propIdx += 2) -+ { -+ szValue = PP_evalProperty (marginProps[propIdx], 0, 0, pAP, m_pDocument, true); -+ m_utf8_1 = static_cast(szValue); -+ styleNameValue (marginProps[propIdx + 1], m_utf8_1); -+ } -+ -+ styleClose (); // end of: body { } -+ styleClose (); // end of: @media print { } -+ -+ if(m_bHaveHeader) _populateHeaderStyle(); -+ if(m_bHaveFooter) _populateFooterStyle(); -+ -+ m_utf8_1 = "body"; -+ styleOpen (m_utf8_1); -+ -+ for (UT_uint32 i = 0; i < pStyle->getPropertyCount (); i++) -+ { -+ pStyle->getNthProperty (i, szName, szValue); -+ -+ if (( szName == 0) || ( szValue == 0)) continue; // paranoid? moi? -+ if ((*szName == 0) || (*szValue == 0)) continue; -+ -+ if (strstr (szName, "margin")) continue; -+ if (!is_CSS (reinterpret_cast(szName))) continue; -+ -+ if (strcmp (szName, "font-family") == 0) -+ { -+ if ((strcmp (szValue, "serif") == 0) || -+ (strcmp (szValue, "sans-serif") == 0) || -+ (strcmp (szValue, "cursive") == 0) || -+ (strcmp (szValue, "fantasy") == 0) || -+ (strcmp (szValue, "monospace") == 0)) -+ { -+ m_utf8_1 = static_cast(szValue); -+ } -+ else -+ { -+ m_utf8_1 = "'"; -+ m_utf8_1 += static_cast(szValue); -+ m_utf8_1 += "'"; -+ } -+ } -+ else if (strcmp (szName, "color") == 0) -+ { -+ if (IS_TRANSPARENT_COLOR (szValue)) continue; -+ -+ if (*szValue != '#') -+ m_utf8_1 = "#"; -+ else -+ m_utf8_1.clear(); -+ -+ m_utf8_1 += static_cast(szValue); -+ } -+ else m_utf8_1 = static_cast(szValue); -+ -+ styleNameValue (szName, m_utf8_1); -+ } -+ szValue = PP_evalProperty ("background-color", 0, 0, pAP, m_pDocument, true); -+ if(szValue && !IS_TRANSPARENT_COLOR (szValue)) -+ { -+ if (*szValue != '#') -+ m_utf8_1 = "#"; -+ else -+ m_utf8_1.clear(); -+ -+ m_utf8_1 += static_cast(szValue); -+ -+ styleNameValue ("background-color", m_utf8_1); -+ } -+ styleClose (); // end of: body { } -+ -+#ifdef HTML_TABLES_SUPPORTED -+ szValue = PP_evalProperty ("width", 0, 0, pAP, m_pDocument, true); -+ -+ m_utf8_1 = "table"; -+ styleOpen (m_utf8_1); -+ -+ if(get_Abs_Units() && szValue && *szValue) -+ { -+ double dMM = UT_convertToDimension(szValue, DIM_MM); -+ UT_UTF8String_sprintf(m_utf8_1, "%.1fmm", dMM); -+ styleNameValue ("width", m_utf8_1); -+ } -+ else if(get_Scale_Units() && szValue && *szValue) -+ { -+ m_utf8_1 = "100%"; -+ styleNameValue ("width", m_utf8_1); -+ } -+ // else do nothing, because in flow-based document width is left to box model -+ -+ styleClose (); // end of: table { } -+ -+ m_utf8_1 = "td"; -+ styleOpen (m_utf8_1); -+ -+ m_utf8_1 = "collapse"; -+ styleNameValue ("border-collapse", m_utf8_1); -+ -+ m_utf8_1 = "left"; -+ styleNameValue ("text-align", m_utf8_1); -+ -+ m_utf8_1 = "top"; -+ styleNameValue ("vertical-align", m_utf8_1); -+ -+ styleClose (); // end of: td { } -+#endif /* HTML_TABLES_SUPPORTED */ -+ } -+ -+ m_style_tree->print (this); -+ -+ if (get_Embed_CSS ()) -+ { -+ tagCommentClose (); -+ m_utf8_1 = "style"; -+ tagClose (TT_STYLE, m_utf8_1); -+ } -+ else _closeStyleSheet (); -+} -+ -+/*! -+ * This closes open section tags and starts new one for embedded struxes -+ */ -+void s_HTML_Listener::startEmbeddedStrux(void) -+{ -+ if (m_bInSection) _closeSection (); -+ -+ m_utf8_1 = "div"; -+ tagOpen (TT_DIV, m_utf8_1); -+ m_bInSection = true; -+} -+ -+void s_HTML_Listener::_openSection (PT_AttrPropIndex api, UT_uint16 iSectionSpecialType) -+{ -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ -+ if (m_bFirstWrite) _outputBegin (api); -+ -+ if (m_bInSection) _closeSection (); -+ -+ const PP_AttrProp* pSectionAP = NULL; -+ m_pDocument->getAttrProp(api, &pSectionAP); -+ -+ m_utf8_1 = "div"; -+ -+ switch (iSectionSpecialType) -+ { -+ case 1: -+ { -+ m_utf8_1 += " id=\"header\""; -+ m_bInSection = true; -+ break; -+ } -+ case 2: -+ { -+ m_utf8_1 += " id=\"footer\""; -+ m_bInSection = true; -+ break; -+ } -+ case 3: -+ { -+ m_utf8_1 += " id=\"main\""; -+ break; -+ } -+ default: -+ m_bInSection = true; -+ break; -+ } -+ -+ tagOpen (TT_DIV, m_utf8_1); -+ m_dPageWidthInches = m_pDocument->m_docPageSize.Width(DIM_IN); -+ -+ const char* pszLeftMargin = NULL; -+ const char* pszRightMargin = NULL; -+ const char* pszTopMargin = NULL; -+ const char* pszBottomMargin = NULL; -+ pSectionAP->getProperty("page-margin-left", (const gchar *&)pszLeftMargin); -+ pSectionAP->getProperty("page-margin-right", (const gchar *&)pszRightMargin); -+ pSectionAP->getProperty("page-margin-top", (const gchar *&)pszTopMargin); -+ pSectionAP->getProperty("page-margin-bottom", (const gchar *&)pszBottomMargin); -+ -+ if(pszLeftMargin && pszLeftMargin[0]) -+ { -+ m_dSecLeftMarginInches = UT_convertToInches(pszLeftMargin); -+ } -+ else -+ { -+ m_dSecLeftMarginInches = 1.0; -+ } -+ -+ if(pszRightMargin && pszRightMargin[0]) -+ { -+ m_dSecRightMarginInches = UT_convertToInches(pszRightMargin); -+ } -+ else -+ { -+ m_dSecRightMarginInches = 1.0; -+ } -+ -+ if(pszTopMargin && pszTopMargin[0]) -+ { -+ m_dSecTopMarginInches = UT_convertToInches(pszTopMargin); -+ } -+ else -+ { -+ m_dSecTopMarginInches = 1.0; -+ } -+ -+ if(pszBottomMargin && pszBottomMargin[0]) -+ { -+ m_dSecBottomMarginInches = UT_convertToInches(pszBottomMargin); -+ } -+ else -+ { -+ m_dSecBottomMarginInches = 1.0; -+ } -+ -+} -+ -+void s_HTML_Listener::_closeSection (void) -+{ -+ // When we start tracking list ideas and doing store-first-write-later on them, -+ // and then start supporting unified discontinuous lists, -+ // complications with questionable worthwhileness, -+ // we will no longer have to pop out for every section break even when there are identical listIds spanning multiple sections. -+ // Until then, this is necessary. -+ listPopToDepth(0); -+ -+ if (tagTop() == TT_SPAN) { -+ UT_DEBUGMSG(("_closeSection closing span\n")); -+ tagClose(TT_SPAN, "span"); -+ } -+ -+ if (m_bInBlock && (tagTop() == TT_P)) { // If only the first is true, we have a first-order tag mismatch. The alternative with not testing the latter is a second-order tag mismatch. -+ UT_DEBUGMSG(("_closeSection closing block\n")); -+ // _closeTag (); // We need to investigate the tag stack usage of this, and whether or not we really would rather specify the tag in all cases. -+ tagClose(TT_P, "p"); -+ } -+ // Need to investigate whether we can safely uncomment this without undoing heading work, or any other kind using unended structures like lists. -+ // _popUnendedStructures(); // Close lists, and possibly other stuff. Even if it theoretically can span sections, we run a high risk of corrupting the document. -+ -+ if (m_bInSection && (tagTop () == TT_DIV)) -+ { -+ m_utf8_1 = "div"; -+ UT_DEBUGMSG(("_closeSection closing div\n")); -+ tagClose (TT_DIV, m_utf8_1); -+ } -+ m_bInSection = false; -+} -+ -+/*! This function returns true if the name of the PD_Style which style is based -+ on, without whitespace, is the same as `from`, and otherwise returns false. -+*/ -+bool s_HTML_Listener::_inherits (const char * style, const char * from) -+{ -+ if ((style == 0) || (from == 0)) return false; -+ -+ bool bret = false; -+ -+ PD_Style * pStyle = 0; -+ -+ if (m_pDocument->getStyle (style, &pStyle)) -+ if (pStyle) -+ { -+ PD_Style * pBasedOn = pStyle->getBasedOn (); -+ if (pBasedOn) -+ { -+ /* The name of the style is stored in the PT_NAME_ATTRIBUTE_NAME -+ * attribute within the style -+ */ -+ const gchar * szName = 0; -+ pBasedOn->getAttribute (PT_NAME_ATTRIBUTE_NAME, szName); -+ -+ if (szName) -+ { -+ /* careful!! -+ */ -+ s_removeWhiteSpace (static_cast(szName), m_utf8_0, true); -+ -+ if (m_utf8_0.utf8_str ()) -+ bret = (strcmp (from, m_utf8_0.utf8_str ()) == 0); -+ } -+ } -+ } -+ return bret; -+} -+ -+UT_uint32 s_HTML_Listener::listDepth () -+{ -+ return static_cast(m_utsListType.getDepth ()); -+} -+ -+UT_uint32 s_HTML_Listener::listType () -+{ -+ UT_sint32 i = 0; -+ m_utsListType.viewTop (i); -+ return (UT_uint32)i; -+} -+ -+void s_HTML_Listener::listPush (UT_uint32 type, const char * ClassName) -+{ -+ if (tagTop () == TT_LI) -+ { -+ m_utf8_1 = MYEOL; -+ tagRaw (m_utf8_1); -+ } -+ -+ UT_uint32 tagID; -+ -+ if (type == BT_BULLETLIST) -+ { -+ tagID = TT_UL; -+ m_utf8_1 = "ul"; -+ } -+ else -+ { -+ tagID = TT_OL; -+ m_utf8_1 = "ol"; -+ } -+ tagOpen (tagID, m_utf8_1); -+ -+ m_utsListType.push (static_cast(type)); -+} -+ -+void s_HTML_Listener::listPop () -+{ -+ if (tagTop () == TT_SPAN) -+ { -+ // We don't just tagPop() for the sake of prettiness, apparently. -+ m_utf8_1 = "span"; -+ tagClose (TT_SPAN, m_utf8_1, ws_Post); -+ } -+#if 0 -+ // This code may come in handy if AbiWord ever supported listed frames, which is conceivable -+ if (m_bInFrame && tagTop () == TT_DIV) // Frame embedded in list, hopefully. I _really_ hope we don't have a first order section in a list. -+ { -+ if(m_bInTextBox) -+ _closeTextBox(); -+ else -+ { -+ UT_DEBUGMSG(("WARNING: Popping a frame which is not a textbox within a list item, heaven help us \n")); -+ -+ m_utf8_1 = "div"; -+ tagClose (TT_DIV, m_utf8_1); -+ } -+ } -+#endif -+ if (tagTop () == TT_LI) -+ { -+ m_utf8_1 = "li"; -+ tagClose (TT_LI, m_utf8_1); -+ } -+ -+ UT_sint32 type = 0; -+ m_utsListType.pop (&type); -+ -+ UT_uint32 tagID; -+ -+ if (type == BT_BULLETLIST) -+ { -+ tagID = TT_UL; -+ m_utf8_1 = "ul"; -+ } -+ else -+ { -+ tagID = TT_OL; -+ m_utf8_1 = "ol"; -+ } -+ tagClose (tagID, m_utf8_1); -+ -+ if (tagTop () == TT_LI) -+ { -+ m_utf8_1 = ""; -+ tagNewIndent (m_utf8_1, tagIndent () - 1); -+ tagRaw (m_utf8_1); -+ } -+} -+ -+void s_HTML_Listener::listPopToDepth (UT_uint32 depth) -+{ -+ if (listDepth () <= depth) return; -+ -+ UT_uint32 count = listDepth () - depth; -+ for (UT_uint32 i = 0; i < count; i++) listPop (); -+} -+ -+void s_HTML_Listener::_openTag (PT_AttrPropIndex api, PL_StruxDocHandle sdh) -+{ -+ if (m_bFirstWrite) _openSection (api, 0); -+ -+ if (!m_bInSection) return; -+ -+ m_StyleTreeInline = 0; -+ m_StyleTreeBlock = 0; -+ -+ if (m_bInBlock) -+ { -+ if (tagTop () == TT_A) -+ { -+ m_utf8_1 = "a"; -+ tagClose (TT_A, m_utf8_1, ws_None); -+ } -+ if (tagTop () != TT_LI) _closeTag (); -+ } -+ m_bWroteText = false; -+ -+ const gchar * szDefault = "Normal"; // TODO: should be/is a #define somewhere? -+ -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ -+ if ((!bHaveProp || (pAP == 0)) && !m_bInFrame) // [Appears to be and we're assuming it's a]

with no style attribute, and no properties either, and not a frame embedded in the list -+ { -+ listPopToDepth (0); -+ -+ m_utf8_1 = "p"; -+ tagOpen (TT_P, m_utf8_1, ws_Pre); -+ -+ m_utf8_style = szDefault; -+ -+ m_iBlockType = BT_NORMAL; -+ m_bInBlock = true; -+ return; -+ } -+ -+ UT_uint32 tagID = TT_OTHER; -+ -+ bool tagPending = false; -+ -+ const gchar * szValue = 0; -+ const gchar * szLevel = 0; -+ const gchar * szListID = 0; -+ const gchar * szStyleType = 0; -+ -+ /* This is the point at which we differentiate between different -+ * types of tags in HTML. We do a sequence of checks on the "style" -+ * and other useful attributes of the current block. First we check -+ * if we are in a block which has a named "style" or which contains -+ * list information. -+ * -+ * Weaknesses in this code include the mutability of our stored -+ * document state. I've had it happen where the representation of -+ * lists in the abiword format changes, which tends to break this -+ * code. -+ */ -+ -+ bool have_style = pAP->getAttribute (PT_STYLE_ATTRIBUTE_NAME, szValue); -+ bool have_listID = pAP->getAttribute (PT_LISTID_ATTRIBUTE_NAME, szListID); -+ bool zero_listID = true; -+ bool bClassAsTag = false; -+ -+ if (have_listID) zero_listID = (strcmp (szListID, "0") == 0); -+ -+ /* A nonzero "listid" attribute value indicates that we -+ * are in a list item, so we need to process it, HTML-style. -+ */ -+ -+ /* Specify a default style name for this list item if it -+ * doesn't already have one. -+ */ -+ if (!have_style) szValue = szDefault; -+ -+ m_utf8_style = szValue; -+ -+ m_StyleTreeBlock = m_style_tree->find (szValue); -+ -+ if (!zero_listID) -+ { -+ /* Desired list type (numbered / bullet) -+ */ -+ if (!pAP->getProperty ("list-style", szStyleType)) szStyleType = szValue; -+ -+ if (strcmp (static_cast(szStyleType), "Bullet List") == 0) -+ { -+ m_iBlockType = BT_BULLETLIST; -+ } -+ else -+ { -+ m_iBlockType = BT_NUMBEREDLIST; -+ } -+ -+ /* Find out how deeply nested this list item is. -+ */ -+ pAP->getAttribute ("level", szLevel); -+ if(szLevel) -+ { -+ m_iListDepth = atoi (static_cast(szLevel)); -+ } -+ else -+ { -+ m_iListDepth = 0; -+ } -+ /* TODO: why can m_iListDepth be zero sometimes ?? (numbered headings?) -+ * UPDATE: I don't know, but it probably shouldn't be handled this way because the definition of 0 -+ * from earlier in the code is that it means we are not in a list of any sort. -+ * For numbered headings and the like, if that's the handling of it, we may actually end up -+ * with more than one list after having 'risen to desired list depth'. -MG -+ */ -+ if (m_iListDepth == 0) m_iListDepth = 1; -+ -+ /* Rise to desired list depth if currently too deep -+ */ -+ listPopToDepth (m_iListDepth); -+ -+ /* current list & desired list have same depth but different types... -+ * pop one and add new below -+ */ -+ if ((m_iListDepth == listDepth ()) && (m_iBlockType != listType ())) -+ { -+ listPop (); -+ } -+ -+ /* If our list is getting deeper, we need to start a nested list. -+ * Assumption: list can only increase in depth by 1. -+ */ -+ if (m_iListDepth > listDepth ()) -+ { -+ listPush (m_iBlockType, szValue); -+ } -+ else if (tagTop () == TT_LI) -+ { -+ m_utf8_1 = "li"; -+ tagClose (TT_LI, m_utf8_1, ws_Post); -+ } -+ -+ tagID = TT_LI; -+ tagPending = true; -+ -+ m_utf8_1 = "li"; -+ -+ if (m_StyleTreeBlock) -+ if (m_StyleTreeBlock->class_list().byteLength ()) -+ { -+ UT_UTF8String escape; -+ m_utf8_1 += " class=\""; -+ if(get_Class_Only()) -+ { -+ escape = m_StyleTreeBlock->class_name (); -+ m_utf8_1 += escape.escapeXML(); -+ } -+ else -+ { -+ escape = m_StyleTreeBlock->class_list (); -+ m_utf8_1 += escape.escapeXML(); -+ } -+ -+ m_utf8_1 += "\""; -+ } -+ } -+ else if (have_style) -+ { -+ listPopToDepth (0); -+ -+ const s_StyleTree * tree = m_StyleTreeBlock; -+ -+ bool bAddAWMLStyle = false; -+ if (get_Allow_AWML () && !get_HTML4 ()) bAddAWMLStyle = true; -+ -+ if ((g_ascii_strcasecmp (static_cast(szValue), "Heading 1") == 0) || -+ (g_ascii_strcasecmp (static_cast(szValue), "Numbered Heading 1") == 0)) -+ { -+ m_iBlockType = BT_HEADING1; -+ tagID = TT_H1; -+ tagPending = true; -+ bClassAsTag = true; -+ -+ if (m_toc->docHasTOC()) { -+ m_utf8_1 = UT_UTF8String_sprintf("h1 id=\"AbiTOC%d__\"", m_heading_count); -+ m_heading_count++; -+ } -+ else -+ m_utf8_1 = "h1"; -+ -+ if (g_ascii_strcasecmp (static_cast(szValue), "Heading 1") == 0) -+ bAddAWMLStyle = false; -+ } -+ else if ((g_ascii_strcasecmp (static_cast(szValue), "Heading 2") == 0) || -+ (g_ascii_strcasecmp (static_cast(szValue), "Numbered Heading 2") == 0)) -+ { -+ m_iBlockType = BT_HEADING2; -+ tagID = TT_H2; -+ tagPending = true; -+ bClassAsTag = true; -+ -+ if (m_toc->docHasTOC()) { -+ m_utf8_1 = UT_UTF8String_sprintf("h2 id=\"AbiTOC%d__\"", m_heading_count); -+ m_heading_count++; -+ } -+ else -+ m_utf8_1 = "h2"; -+ -+ if (g_ascii_strcasecmp (static_cast(szValue), "Heading 2") == 0) -+ bAddAWMLStyle = false; -+ } -+ else if ((g_ascii_strcasecmp (static_cast(szValue), "Heading 3") == 0) || -+ (g_ascii_strcasecmp (static_cast(szValue), "Numbered Heading 3") == 0)) -+ { -+ m_iBlockType = BT_HEADING3; -+ tagID = TT_H3; -+ tagPending = true; -+ bClassAsTag = true; -+ -+ if (m_toc->docHasTOC()) { -+ m_utf8_1 = UT_UTF8String_sprintf("h3 id=\"AbiTOC%d__\"", m_heading_count); -+ m_heading_count++; -+ } -+ else -+ m_utf8_1 = "h3"; -+ -+ if (g_ascii_strcasecmp (static_cast(szValue), "Heading 3") == 0) -+ bAddAWMLStyle = false; -+ } -+ else if (g_ascii_strcasecmp (static_cast(szValue), "Block Text") == 0) -+ { -+ m_iBlockType = BT_BLOCKTEXT; -+ tagID = TT_BLOCKQUOTE; -+ tagPending = true; -+ bClassAsTag = true; -+ m_utf8_1 = "blockquote"; -+ bAddAWMLStyle = false; -+ } -+ else if (g_ascii_strcasecmp (static_cast(szValue), "Plain Text") == 0) -+ { -+ m_iBlockType = BT_NORMAL; -+ tagID = TT_P; -+ tagPending = true; -+ bClassAsTag = true; -+ m_utf8_1 = "p class=\"plain_text\""; -+ bAddAWMLStyle = false; -+ } -+ else if (g_ascii_strcasecmp (static_cast(szValue), "Normal") == 0) -+ { -+ m_iBlockType = BT_NORMAL; -+ tagID = TT_P; -+ tagPending = true; -+ bClassAsTag = true; -+ -+ // if class-only is specified, we want -+ // class=Normal because changing definition of -+ // unqualified

in a stylesheet tends to be -+ // rather messy; it is much easier to define -+ // P.Normal -+ if(get_Class_Only()) -+ m_utf8_1 = "p class=\"Normal\""; -+ else -+ m_utf8_1 = "p"; -+ -+ bAddAWMLStyle = false; -+ } -+ else if (tree == 0) // hmm... -+ { -+ m_iBlockType = BT_NORMAL; -+ tagID = TT_P; -+ tagPending = true; -+ m_utf8_1 = "p"; -+ } -+ else if (tree->descends ("Heading 1")) -+ { -+ m_iBlockType = BT_HEADING1; -+ tagID = TT_H1; -+ tagPending = true; -+ bClassAsTag = true; -+ -+ if (m_toc->docHasTOC()) { -+ m_utf8_1 = UT_UTF8String_sprintf("h1 id=\"AbiTOC%d__\"", m_heading_count); -+ m_heading_count++; -+ } else { -+ m_utf8_1 = "h1"; -+ } -+ } -+ else if (tree->descends ("Heading 2")) -+ { -+ m_iBlockType = BT_HEADING2; -+ tagID = TT_H2; -+ tagPending = true; -+ bClassAsTag = true; -+ -+ if (m_toc->docHasTOC()) { -+ m_utf8_1 = UT_UTF8String_sprintf("h2 id=\"AbiTOC%d__\"", m_heading_count); -+ m_heading_count++; -+ } else { -+ m_utf8_1 = "h2"; -+ } -+ } -+ else if (tree->descends ("Heading 3")) -+ { -+ m_iBlockType = BT_HEADING3; -+ tagID = TT_H3; -+ tagPending = true; -+ bClassAsTag = true; -+ -+ if (m_toc->docHasTOC()) { -+ m_utf8_1 = UT_UTF8String_sprintf("h3 id=\"AbiTOC%d__\"", m_heading_count); -+ m_heading_count++; -+ } else { -+ m_utf8_1 = "h3"; -+ } -+ } -+ else if (tree->descends ("Block Text")) -+ { -+ m_iBlockType = BT_BLOCKTEXT; -+ tagID = TT_BLOCKQUOTE; -+ tagPending = true; -+ bClassAsTag = true; -+ m_utf8_1 = "blockquote"; -+ } -+ else if (tree->descends ("Plain Text")) -+ { -+ m_iBlockType = BT_NORMAL; -+ tagID = TT_P; -+ tagPending = true; -+ bClassAsTag = true; -+ m_utf8_1 = "p class=\"plain_text\""; -+ } -+ else if (tree->descends ("Normal")) -+ { -+ m_iBlockType = BT_NORMAL; -+ tagID = TT_P; -+ tagPending = true; -+ -+ if (m_toc->docHasTOC() && m_toc->isTOCStyle(szValue)) { -+ m_utf8_1 = UT_UTF8String_sprintf("p id=\"AbiTOC%d__\"", m_heading_count); -+ m_heading_count++; -+ } else { -+ m_utf8_1 = "p"; -+ } -+ } -+ else -+ { -+ m_iBlockType = BT_NORMAL; -+ tagID = TT_P; -+ tagPending = true; -+ -+ if (m_toc->docHasTOC() && m_toc->isTOCStyle(szValue)) { -+ m_utf8_1 = UT_UTF8String_sprintf("p id=\"AbiTOC%d__\"", m_heading_count); -+ m_heading_count++; -+ } else { -+ m_utf8_1 = "p"; -+ } -+ } -+ -+ if (tree && !bClassAsTag) -+ if (tree->class_list().byteLength ()) -+ { -+ UT_UTF8String escape; -+ m_utf8_1 += " class=\""; -+ if(get_Class_Only()) -+ { -+ escape = tree->class_name (); -+ m_utf8_1 += escape.escapeXML(); -+ } -+ else -+ { -+ escape = tree->class_list (); -+ m_utf8_1 += escape.escapeXML(); -+ } -+ m_utf8_1 += "\""; -+ } -+ if (bAddAWMLStyle) -+ { -+ UT_UTF8String escape = szValue; -+ m_utf8_1 += " awml:style=\""; -+ m_utf8_1 += escape.escapeXML(); -+ m_utf8_1 += "\""; -+ } -+ } -+ else // not a list, no style -+ { -+ listPopToDepth (0); -+ -+ m_iBlockType = BT_NORMAL; -+ -+ tagID = TT_P; -+ tagPending = true; -+ -+ m_utf8_1 = "p"; -+ } -+ if (!tagPending) -+ { -+ UT_DEBUGMSG(("WARNING: unexpected!\n")); -+ return; -+ } -+ -+ const gchar * szP_DomDir = 0; -+ pAP->getProperty ("dom-dir", szP_DomDir); -+ -+ if (szP_DomDir) // any reason why this can't be used with -+ //

or
 ?? no
-+	{
-+		m_utf8_1 += " dir=\"";
-+		m_utf8_1 += szP_DomDir;
-+		m_utf8_1 += "\"";
-+	}
-+	
-+	if(get_Class_Only())
-+		goto class_only;
-+	
-+	{
-+		const gchar * szP_TextAlign = 0;
-+		const gchar * szP_MarginBottom = 0;
-+		const gchar * szP_MarginTop = 0;
-+		const gchar * szP_MarginLeft = 0;
-+		const gchar * szP_MarginRight = 0;
-+		const gchar * szP_TextIndent = 0;
-+
-+		pAP->getProperty ("text-align",    szP_TextAlign);
-+		pAP->getProperty ("margin-bottom", szP_MarginBottom);
-+		pAP->getProperty ("margin-top",    szP_MarginTop);
-+		pAP->getProperty ("margin-right",  szP_MarginRight);
-+
-+		/* NOTE: For both "margin-left" and "text-indent" for lists,
-+		 * Abi's behaviour and HTML's do not match.
-+		 * Furthermore, it seems like all blocks have a "margin-left"
-+		 * and "text-indent", even if they are zero, which adds
-+		 * significant clutter.  These are all manually taken care of
-+		 * below.  I think that the computation of these attributes
-+		 * needs to be rethought. - John
-+		 */
-+		if ((tagID != TT_LI) && (tagID != TT_TD))
-+		{
-+			if (pAP->getProperty ("margin-left", szP_MarginLeft))
-+				if (strstr (szP_MarginLeft, "0.0000"))
-+					szP_MarginLeft = 0;
-+
-+			if (pAP->getProperty ("text-indent", szP_TextIndent))
-+				if (strstr (szP_TextIndent, "0.0000"))
-+					szP_TextIndent = 0;
-+		}
-+
-+
-+		bool validProp = (szP_TextAlign || szP_MarginBottom || szP_MarginTop ||
-+						  szP_MarginLeft || szP_MarginRight || szP_TextIndent);
-+
-+		/* Assumption: never get property set with block text, plain text. Probably true...
-+		 */
-+		if ((m_iBlockType != BT_PLAINTEXT) &&
-+			(m_iBlockType != BT_BLOCKTEXT) && validProp)
-+		{
-+			m_utf8_1 += " style=\"";
-+
-+			bool first = true;
-+
-+			if (szP_TextAlign)
-+			{
-+				if (!first) m_utf8_1 += ";";
-+				m_utf8_1 += "text-align:";
-+				m_utf8_1 += szP_TextAlign;
-+				first = false;
-+			}
-+			if (szP_MarginBottom)
-+			{
-+				if (!first) m_utf8_1 += ";";
-+				m_utf8_1 += "margin-bottom:";
-+				m_utf8_1 += szP_MarginBottom;
-+				first = false;
-+			}
-+			if (szP_MarginTop)
-+			{
-+				if (!first) m_utf8_1 += ";";
-+				m_utf8_1 += "margin-top:";
-+				m_utf8_1 += szP_MarginTop;
-+				first = false;
-+			}
-+			if (szP_MarginRight)
-+			{
-+				if (!first) m_utf8_1 += ";";
-+				m_utf8_1 += "margin-right:";
-+				m_utf8_1 += szP_MarginRight;
-+				first = false;
-+			}
-+			if (szP_MarginLeft)
-+			{
-+				if (!first) m_utf8_1 += ";";
-+				m_utf8_1 += "margin-left:";
-+				m_utf8_1 += szP_MarginLeft;
-+				first = false;
-+			}
-+			if (szP_TextIndent)
-+			{
-+				if (!first) m_utf8_1 += ";";
-+				m_utf8_1 += "text-indent:";
-+				m_utf8_1 += szP_TextIndent;
-+				first = false;
-+			}
-+
-+			m_utf8_1 += "\"";
-+		}
-+	}
-+	
-+ class_only:	
-+	tagOpen (tagID, m_utf8_1, ws_Pre);
-+
-+	m_bInBlock = true;
-+}
-+
-+void s_HTML_Listener::_closeTag (void)
-+{
-+	if (!m_bInBlock) return;
-+
-+	if (m_bInSpan) _closeSpan ();
-+	
-+	if (tagTop () == TT_A)
-+	{
-+		m_utf8_1 = "a";
-+		tagClose (TT_A, m_utf8_1, ws_None);
-+	}
-+	if (m_iBlockType == BT_NORMAL)
-+	{
-+#ifdef HTML_EMPTY_PARA_LF
-+		if (!m_bWroteText) // TODO: is this really ideal?
-+		{
-+			m_utf8_1 = "br";
-+			tagOpenClose (m_utf8_1, get_HTML4 (), ws_None);
-+		}
-+#endif /* HTML_EMPTY_PARA_LF */
-+		if (tagTop () == TT_P)
-+		{
-+			m_utf8_1 = "p";
-+			tagClose (TT_P, m_utf8_1, ws_Post);
-+		}
-+	}
-+	else if (m_iBlockType == BT_HEADING1) 
-+	{
-+		if (tagTop () == TT_H1)
-+		{
-+			m_utf8_1 = "h1";
-+			tagClose (TT_H1, m_utf8_1, ws_Post);
-+		}
-+	}
-+	else if (m_iBlockType == BT_HEADING2)
-+	{
-+		if (tagTop () == TT_H2)
-+		{
-+			m_utf8_1 = "h2";
-+			tagClose (TT_H2, m_utf8_1, ws_Post);
-+		}
-+	}
-+	else if (m_iBlockType == BT_HEADING3)
-+	{
-+		if (tagTop () == TT_H3)
-+		{
-+			m_utf8_1 = "h3";
-+			tagClose (TT_H3, m_utf8_1, ws_Post);
-+		}
-+	}
-+	else if (m_iBlockType == BT_BLOCKTEXT)
-+	{
-+		if (tagTop () == TT_BLOCKQUOTE)
-+		{
-+			m_utf8_1 = "blockquote";
-+			tagClose (TT_BLOCKQUOTE, m_utf8_1, ws_Post);
-+		}
-+	}
-+	else if (m_iBlockType == BT_PLAINTEXT)
-+	{
-+		if (tagTop () == TT_PRE)
-+		{
-+			m_utf8_1 = "pre";
-+			tagClose (TT_PRE, m_utf8_1, ws_Post);
-+		}
-+	}
-+	else if (m_iBlockType == BT_NUMBEREDLIST || m_iBlockType == BT_BULLETLIST)
-+	{	
-+		/* do nothing, lists are handled differently, as they have multiple tags */ 
-+	}
-+ 	else
-+	{
-+		UT_DEBUGMSG(("(defaulting to 

)\n")); -+ -+ if (tagTop () == TT_P) -+ { -+ m_utf8_1 = "p"; -+ tagClose (TT_P, m_utf8_1, ws_Post); -+ } -+ } -+ m_bInBlock = false; -+} -+ -+void s_HTML_Listener::_openSpan (PT_AttrPropIndex api) -+{ -+ if (m_bFirstWrite) _openTag (api, 0); -+ -+ if (!m_bInBlock) return; -+ -+ m_StyleTreeInline = 0; -+ -+ // make sure any unit conversions are correct -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = (api ? (m_pDocument->getAttrProp (api, &pAP)) : false); -+ -+ if (m_bInSpan && m_apiLastSpan == api) -+ return; -+ -+ if (!bHaveProp || (pAP == 0)) -+ { -+ if (m_bInSpan) _closeSpan (); -+ return; -+ } -+ -+ const gchar * szA_Style = 0; -+ -+ bool have_style = pAP->getAttribute (PT_STYLE_ATTRIBUTE_NAME, szA_Style); -+ if (have_style) -+ if (m_utf8_style == szA_Style) // inline style is block style; ignore -+ have_style = false; -+ -+ const s_StyleTree * tree = 0; -+ if (have_style) -+ tree = m_style_tree->find (szA_Style); -+ -+ m_StyleTreeInline = tree; -+ -+ bool first = true; -+ bool bInSpan = false; -+ -+ if (tree) -+ if (tree->class_list().byteLength ()) -+ { -+ UT_UTF8String escape; -+ m_utf8_1 = "span class=\""; -+ if(get_Class_Only()) -+ { -+ escape = tree->class_name (); -+ m_utf8_1 += escape.escapeXML(); -+ } -+ else -+ { -+ escape = tree->class_list (); -+ m_utf8_1 += escape.escapeXML(); -+ } -+ -+ m_utf8_1 += "\""; -+ bInSpan = true; -+ first = false; -+ if(get_Class_Only()) -+ goto class_only; -+ } -+ -+ { -+ const gchar * szP_FontWeight = 0; -+ const gchar * szP_FontStyle = 0; -+ const gchar * szP_FontSize = 0; -+ const gchar * szP_FontFamily = 0; -+ const gchar * szP_TextDecoration = 0; -+ const gchar * szP_TextPosition = 0; -+ const gchar * szP_Color = 0; -+ const gchar * szP_BgColor = 0; -+ const gchar * szP_Display = 0; -+ -+ pAP->getProperty ("font-weight", szP_FontWeight); -+ pAP->getProperty ("font-style", szP_FontStyle); -+ pAP->getProperty ("font-size", szP_FontSize); -+ pAP->getProperty ("font-family", szP_FontFamily); -+ pAP->getProperty ("text-decoration", szP_TextDecoration); -+ pAP->getProperty ("text-position", szP_TextPosition); -+ pAP->getProperty ("color", szP_Color); -+ pAP->getProperty ("bgcolor", szP_BgColor); -+ pAP->getProperty ("display", szP_Display); -+ -+ if(first) -+ m_utf8_1 = "span style=\""; -+ else -+ m_utf8_1 += " style=\""; -+ -+ /* TODO: this bold/italic check needs re-thought -+ */ -+ if (szP_FontWeight) -+ if (strcmp (szP_FontWeight, "bold") == 0) -+ if (!compareStyle ("font-weight", "bold")) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "font-weight:bold"; -+ first = false; -+ } -+ if (szP_FontStyle) -+ if (strcmp (szP_FontStyle, "italic") == 0) -+ if (!compareStyle ("font-style", "italic")) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "font-style:italic"; -+ first = false; -+ } -+ -+ if (szP_FontSize) -+ { -+ char buf[16]; -+ -+ { -+ sprintf (buf, "%g", UT_convertToPoints (szP_FontSize)); -+ } -+ -+ m_utf8_0 = buf; -+ m_utf8_0 += "pt"; -+ -+ if (!compareStyle ("font-size", m_utf8_0.utf8_str ())) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "font-size:"; -+ m_utf8_1 += m_utf8_0; -+ first = false; -+ } -+ } -+ if (szP_FontFamily) -+ { -+ if ((strcmp (szP_FontFamily, "serif") == 0) || -+ (strcmp (szP_FontFamily, "sans-serif") == 0) || -+ (strcmp (szP_FontFamily, "cursive") == 0) || -+ (strcmp (szP_FontFamily, "fantasy") == 0) || -+ (strcmp (szP_FontFamily, "monospace") == 0)) -+ { -+ m_utf8_0 = static_cast(szP_FontFamily); -+ } -+ else -+ { -+ m_utf8_0 = "'"; -+ m_utf8_0 += static_cast(szP_FontFamily); -+ m_utf8_0 += "'"; -+ } -+ if (!compareStyle ("font-family", m_utf8_0.utf8_str ())) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "font-family:"; -+ m_utf8_1 += m_utf8_0; -+ first = false; -+ } -+ } -+ if (szP_TextDecoration) -+ { -+ bool bUnderline = (strstr (szP_TextDecoration, "underline") != NULL); -+ bool bLineThrough = (strstr (szP_TextDecoration, "line-through") != NULL); -+ bool bOverline = (strstr (szP_TextDecoration, "overline") != NULL); -+ -+ if (bUnderline || bLineThrough || bOverline) -+ { -+ m_utf8_0 = ""; -+ if (bUnderline) m_utf8_0 += "underline"; -+ if (bLineThrough) -+ { -+ if (bUnderline) m_utf8_0 += ", "; -+ m_utf8_0 += "line-through"; -+ } -+ if (bOverline) -+ { -+ if (bUnderline || bLineThrough) m_utf8_0 += ", "; -+ m_utf8_0 += "overline"; -+ } -+ if (!compareStyle ("text-decoration", m_utf8_0.utf8_str ())) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "text-decoration:"; -+ m_utf8_1 += m_utf8_0; -+ first = false; -+ } -+ } -+ } -+ if (szP_TextPosition) -+ { -+ if (strcmp (szP_TextPosition, "superscript") == 0) -+ { -+ if (!compareStyle ("vertical-align", "super")) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "vertical-align:super"; -+ first = false; -+ } -+ } -+ else if (strcmp (szP_TextPosition, "subscript") == 0) -+ { -+ if (!compareStyle ("vertical-align", "sub")) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "vertical-align:sub"; -+ first = false; -+ } -+ } -+ } -+ if (szP_Color) -+ if (!IS_TRANSPARENT_COLOR (szP_Color)) -+ { -+ if (*szP_Color != '#') -+ m_utf8_0 = "#"; -+ else -+ m_utf8_0.clear(); -+ -+ m_utf8_0 += szP_Color; -+ -+ if (!compareStyle ("color", m_utf8_0.utf8_str ())) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "color:"; -+ m_utf8_1 += m_utf8_0; -+ first = false; -+ } -+ } -+ if (szP_BgColor) -+ if (!IS_TRANSPARENT_COLOR (szP_BgColor)) -+ { -+ if (*szP_BgColor != '#') -+ m_utf8_0 = "#"; -+ else -+ m_utf8_0.clear(); -+ -+ m_utf8_0 += szP_BgColor; -+ -+ if (!compareStyle ("background", m_utf8_0.utf8_str ())) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "background:"; -+ m_utf8_1 += m_utf8_0; -+ first = false; -+ } -+ } -+ -+ if (szP_Display) -+ { -+ if (strcmp (szP_Display, "none") == 0) -+ { -+ if (!first) m_utf8_1 += ";"; -+ m_utf8_1 += "display:none"; -+ first = false; -+ } -+ } -+ } -+ -+ class_only: -+ -+ if (first) -+ { -+ /* no style elements specified -+ */ -+ m_utf8_1 = "span"; -+ } -+ else -+ { -+ m_utf8_1 += "\""; -+ bInSpan = true; -+ } -+ -+ const gchar * szP_Lang = 0; -+ pAP->getProperty ("lang", szP_Lang); -+ -+ if (szP_Lang) -+ { -+ if (!get_HTML4 ()) { -+ // we want to emit xml:lang in addition to lang -+ m_utf8_1 += " xml:lang=\""; -+ m_utf8_1 += szP_Lang; -+ m_utf8_1 += "\""; -+ } -+ -+ m_utf8_1 += " lang=\""; -+ m_utf8_1 += szP_Lang; -+ m_utf8_1 += "\""; -+ bInSpan = true; -+ } -+ -+ if (bInSpan) -+ { -+ if (m_bInSpan) -+ { -+ _closeSpan (); -+ } -+ -+ m_utf8_span = m_utf8_1; -+ -+ tagOpen (TT_SPAN, m_utf8_span, ws_None); -+ -+ /* if the dir-override is set, or dir is 'rtl' or 'ltr', we will output -+ * the dir property; however, this property cannot be within a style -+ * sheet, so anything that needs to be added to this code and belongs -+ * within a style property must be above us; further it should be noted -+ * that there is a good chance that the html browser will not handle it -+ * correctly. For instance IE will take dir=rtl as an indication that -+ * the span should have rtl placement on a line, but it will ignore this -+ * value when printing the actual span. -+ */ -+ const gchar * szP_DirOverride = 0; -+ -+ pAP->getProperty ("dir-override", szP_DirOverride); -+ -+ if (szP_DirOverride) -+ if (/* (*szP_DirOverride == 'l') || */(*szP_DirOverride == 'r')) -+ { -+ m_utf8_1 = "bdo dir=\""; -+ m_utf8_1 += szP_DirOverride; -+ m_utf8_1 += "\""; -+ -+ tagOpen (TT_BDO, m_utf8_1, ws_None); -+ } -+ m_apiLastSpan = api; -+ m_bInSpan = true; -+ } -+ else if (m_bInSpan) _closeSpan (); -+} -+ -+void s_HTML_Listener::_closeSpan () -+{ -+ if (tagTop () == TT_A) -+ { -+ tagClose (TT_A, "a", ws_None); -+ } -+ if (tagTop () == TT_BDO) -+ { -+ tagClose (TT_BDO, "bdo", ws_None); -+ } -+ if (tagTop () == TT_SPAN) -+ { -+ tagClose (TT_SPAN, "span", ws_None); -+ } -+ m_bInSpan = false; -+} -+ -+/*! Close up all HTML-structures for which we haven't a definitive end in the piecetable, -+ * such as lists. -+ * \todo Somebody needs to check for others aside from lists, in order to preempt ugly bugs. -+ */ -+void s_HTML_Listener::_popUnendedStructures (void) -+{ -+ if(m_iListDepth) -+ listPopToDepth(0); -+} -+ -+#ifdef HTML_TABLES_SUPPORTED -+ -+void s_HTML_Listener::_fillColWidthsVector(void) -+{ -+ // make sure any unit conversions are correct -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ -+ // -+ // Positioned columns controls -+ // -+ const char * pszColumnProps = m_TableHelper.getTableProp("table-column-props"); -+ UT_sint32 nCols = m_TableHelper.getNumCols (); -+ UT_DEBUGMSG(("Number columns in table %d \n",nCols)); -+ if(m_vecDWidths.getItemCount() > 0) -+ { -+ UT_VECTOR_PURGEALL(double *,m_vecDWidths); -+ m_vecDWidths.clear(); -+ } -+ if(pszColumnProps && *pszColumnProps) -+ { -+ /* -+ These will be properties applied to all columns. To start with, just the -+ widths of each column are specifed. These are translated to layout units. -+ -+ The format of the string of properties is: -+ -+ table-column-props:1.2in/3.0in/1.3in/; -+ -+ So we read back in pszColumnProps -+ 1.2in/3.0in/1.3in/ -+ -+ The "/" characters will be used to delineate different column entries. -+ As new properties for each column are defined these will be delineated with "_" -+ characters. But we'll cross that bridge later. -+ */ -+ UT_DEBUGMSG(("table-column-props:%s \n",pszColumnProps)); -+ UT_String sProps = pszColumnProps; -+ UT_sint32 sizes = sProps.size(); -+ UT_sint32 i =0; -+ UT_sint32 j =0; -+ while(i < sizes) -+ { -+ for (j=i; (ji && sProps[j] == '/') -+ { -+ UT_String sSub = sProps.substr(i,(j-i)); -+ i = j + 1; -+ double * pDWidth = new double; -+ *pDWidth = UT_convertToInches(sSub.c_str()); -+ m_vecDWidths.addItem(pDWidth); -+ } -+ } -+ } -+ // -+ // automatic column widths set to total width divided by nCols -+ // -+ else -+ { -+ // double total = m_dPageWidthInches - m_dSecLeftMarginInches - m_dSecRightMarginInches; -+ UT_sint32 nCols = m_TableHelper.getNumCols (); -+ double totWidth = m_dPageWidthInches - m_dSecLeftMarginInches - m_dSecRightMarginInches; -+ double colWidth = totWidth/nCols; -+ UT_sint32 i = 0; -+ for(i =0; i< nCols; i++) -+ { -+ double * pDWidth = new double; -+ *pDWidth = colWidth; -+ m_vecDWidths.addItem(pDWidth); -+ } -+ } -+} -+ -+ -+void s_HTML_Listener::_openTable (PT_AttrPropIndex api) -+{ -+ // make sure any unit conversions are correct -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ -+ if (m_bFirstWrite) _openSection (api, 0); -+ -+ if (!m_bInSection) return; -+ -+ if(m_iListDepth) -+ listPopToDepth(0); // AbiWord does not support tables in LIs, neither do we. For AbiWord, an LI is a special

. See next line. -+ -+ if (m_bInBlock) _closeTag (); // HTML does not make it any more desirable to embed a table in a

than AbiWord. -+ -+ const PP_AttrProp * pAP = NULL; -+ bool bHaveProp = m_pDocument->getAttrProp (api,&pAP); -+ -+ if (!bHaveProp || (pAP == 0)) return; -+ -+ //UT_sint32 cellPadding = 0; -+ UT_UTF8String styles; -+ -+ const char * prop = m_TableHelper.getTableProp ("table-line-thickness"); -+ -+ UT_sint32 border = 0; -+ -+ if(prop && atof(prop) != 0.0) -+ border = 1; -+ -+ UT_UTF8String border_default = "1pt"; -+ if (prop) -+ { -+ double dPT = UT_convertToDimension(prop, DIM_PT); -+ border_default = UT_UTF8String_sprintf("%.2fpt", dPT); -+ } -+ -+#if 0 -+ const gchar * pszLeftOffset = 0; -+ const gchar * pszTopOffset = 0; -+ const gchar * pszRightOffset = 0; -+ const gchar * pszBottomOffset = 0; -+ -+ pSectionAP->getProperty ("cell-margin-left", pszLeftOffset); -+ pSectionAP->getProperty ("cell-margin-top", pszTopOffset); -+ pSectionAP->getProperty ("cell-margin-right", pszRightOffset); -+ pSectionAP->getProperty ("cell-margin-bottom", pszBottomOffset); -+#endif -+ const char * pszWidth = m_TableHelper.getTableProp ("width"); -+ if (get_Abs_Units()) { -+ if (pszWidth) { -+ if (styles.byteLength ()) styles += ";"; -+ styles += "width:"; -+ // use mm (inches are too big, since we want to use an int). -+ double dMM = UT_convertToDimension(pszWidth, DIM_MM); -+ UT_UTF8String t; -+ UT_UTF8String_sprintf(t, "%.1fmm", dMM); -+ styles += t; -+ } -+ } else if (get_Scale_Units()) { -+ // TEST ME! -+ if (pszWidth) { -+ if (styles.byteLength ()) styles += ";"; -+ styles += "width:"; -+ double tMM = UT_convertToDimension(pszWidth, DIM_MM); -+ double totWidth = m_dPageWidthInches - m_dSecLeftMarginInches - m_dSecRightMarginInches; -+ UT_UTF8String tws = UT_UTF8String_sprintf("%d", totWidth); -+ double pMM = UT_convertToDimension(tws.utf8_str(), DIM_MM); -+ double dPCT = tMM / pMM; -+ UT_UTF8String t; -+ UT_UTF8String_sprintf(t, "%d%%", dPCT); -+ styles += t; -+ } -+ } -+ else { -+ // this should match abi because tables always cover width by default -+ if (styles.byteLength ()) styles += ";"; -+ styles += "width:100%"; -+ } -+ -+ const char * pszBgColor = m_TableHelper.getTableProp ("bgcolor"); -+ if (pszBgColor == NULL) -+ pszBgColor = m_TableHelper.getTableProp ("background-color"); -+ if (pszBgColor) -+ { -+ if (styles.byteLength ()) styles += ";"; -+ styles += "background-color:"; -+ -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBgColor); -+ if (hash) -+ styles += hash; -+ else -+ styles += pszBgColor; -+ } -+ -+ const char * pszBorderColor = NULL; -+ -+ pszBorderColor = m_TableHelper.getTableProp ("color"); -+ if (pszBorderColor) -+ { -+ if (styles.byteLength ()) styles += ";"; -+ styles += "color:"; -+ -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ styles += hash; -+ else -+ styles += pszBorderColor; -+ } -+ -+ // more often than not border attributes are same all around, so -+ // we want to use the border shortcut -+ // 0-L, 1-R, 2-T, 3-B -+ double dB[4] = {0.0,0.0,0.0,0.0}; -+ UT_UTF8String sB[4]; -+ UT_UTF8String sC[4]; -+ UT_UTF8String sS[4]; -+ -+ pszBorderColor = m_TableHelper.getTableProp ("bot-color"); -+ if (pszBorderColor) -+ { -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ sC[3]= hash; -+ else -+ sC[3]= pszBorderColor; -+ } -+ pszBorderColor = m_TableHelper.getTableProp ("left-color"); -+ if (pszBorderColor) -+ { -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ sC[0] = hash; -+ else -+ sC[0] = pszBorderColor; -+ } -+ pszBorderColor = m_TableHelper.getTableProp ("right-color"); -+ if (pszBorderColor) -+ { -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ sC[1] = hash; -+ else -+ sC[1] = pszBorderColor; -+ } -+ pszBorderColor = m_TableHelper.getTableProp ("top-color"); -+ if (pszBorderColor) -+ { -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ sC[2] = hash; -+ else -+ sC[2] = pszBorderColor; -+ } -+ -+ const char * pszBorderStyle = NULL; -+ -+ pszBorderStyle = m_TableHelper.getTableProp ("bot-style"); -+ if (pszBorderStyle) -+ { -+ sS[3]= PP_PropertyMap::linestyle_for_CSS (pszBorderStyle); -+ } -+ pszBorderStyle = m_TableHelper.getTableProp ("left-style"); -+ if (pszBorderStyle) -+ { -+ sS[0] = PP_PropertyMap::linestyle_for_CSS (pszBorderStyle); -+ } -+ pszBorderStyle = m_TableHelper.getTableProp ("right-style"); -+ if (pszBorderStyle) -+ { -+ sS[1] = PP_PropertyMap::linestyle_for_CSS (pszBorderStyle); -+ } -+ pszBorderStyle = m_TableHelper.getTableProp ("top-style"); -+ if (pszBorderStyle) -+ { -+ sS[2] = PP_PropertyMap::linestyle_for_CSS (pszBorderStyle); -+ } -+ -+ const char * pszBorderWidth = NULL; -+ -+ pszBorderWidth = m_TableHelper.getTableProp ("bot-thickness"); -+ if (pszBorderWidth) -+ { -+ dB[3] = UT_convertToDimension(pszBorderWidth, DIM_PT); -+ sB[3] = UT_UTF8String_sprintf("%.2fpt", dB[3]); -+ } -+ else -+ sB[3] += border_default; -+ pszBorderWidth = m_TableHelper.getTableProp ("left-thickness"); -+ if (pszBorderWidth) -+ { -+ dB[0] = UT_convertToDimension(pszBorderWidth, DIM_PT); -+ sB[0] = UT_UTF8String_sprintf("%.2fpt", dB[0]); -+ } -+ else -+ sB[0] = border_default; -+ pszBorderWidth = m_TableHelper.getTableProp ("right-thickness"); -+ if (pszBorderWidth) -+ { -+ dB[1] = UT_convertToDimension(pszBorderWidth, DIM_PT); -+ sB[1] = UT_UTF8String_sprintf("%.2fpt", dB[1]); -+ } -+ else -+ sB[1] = border_default; -+ pszBorderWidth = m_TableHelper.getTableProp ("top-thickness"); -+ if (pszBorderWidth) -+ { -+ dB[2] = UT_convertToDimension(pszBorderWidth, DIM_PT); -+ sB[2] = UT_UTF8String_sprintf("%.2fpt", dB[2]); -+ } -+ else -+ sB[2] += border_default; -+ -+ // now we need to decide which attributes are to be used in the -+ // shortcut -+ UT_uint32 iBCount[4] = {0,0,0,0}; // 0 - L, 1 - R, 2 - T, 3 - B -+ UT_uint32 iCCount[4] = {0,0,0,0}; // 0 - L, 1 - R, 2 - T, 3 - B -+ UT_uint32 iSCount[4] = {0,0,0,0}; // 0 - L, 1 - R, 2 - T, 3 - B -+ UT_uint32 iBMaxIndx = 0, iCMaxIndx = 0, iSMaxIndx = 0; -+ UT_uint32 i = 0; -+ -+ for(i = 0; i < 4; ++i) -+ { -+ for(UT_sint32 j = i+1; j < 4; j++) -+ { -+ if(dB[i] == dB[j]) -+ { -+ iBCount[i]++; -+ iBCount[j]++; -+ } -+ } -+ } -+ -+ for(i = 1; i < 4; i++) -+ { -+ if(iBMaxIndx < iBCount[i]) -+ iBMaxIndx = i; -+ } -+ -+ for(i = 0; i < 4; ++i) -+ { -+ for(UT_sint32 j = i+1; j < 4; j++) -+ { -+ if(sC[i] == sC[j]) -+ { -+ iCCount[i]++; -+ iCCount[j]++; -+ } -+ } -+ } -+ -+ for(i = 1; i < 4; i++) -+ { -+ if(iCMaxIndx < iCCount[i]) -+ iCMaxIndx = i; -+ } -+ -+ for(i = 0; i < 4; ++i) -+ { -+ for(UT_sint32 j = i+1; j < 4; j++) -+ { -+ if(sS[i] == sS[j]) -+ { -+ iSCount[i]++; -+ iSCount[j]++; -+ } -+ } -+ } -+ -+ for(i = 1; i < 4; i++) -+ { -+ if(iSMaxIndx < iSCount[i]) -+ iSMaxIndx = i; -+ } -+ -+ if(styles.size() != 0) styles += ";"; -+ -+ styles += "border:"; -+ styles += sB[iBMaxIndx]; -+ -+ if(sS[iSMaxIndx].size()) -+ { -+ styles += " "; -+ styles += sS[iSMaxIndx]; -+ } -+ -+ -+ if(sC[iCMaxIndx].size()) -+ { -+ styles += " "; -+ styles += sC[iCMaxIndx]; -+ } -+ -+ if(styles.size() != 0) styles += ";"; -+ styles += "border-collapse:collapse;empty-cells:show;table-layout:fixed"; -+ // only add the border style if we didn't already add it in the "border shortcut" -+ if (!sS[iSMaxIndx].size()) styles += ";border-style:solid"; -+ -+ if(iBCount[iBMaxIndx] != 3) -+ { -+ for(i = 0; i < 4; ++i) -+ { -+ if(i == iBMaxIndx || dB[i] == dB[iBMaxIndx] || sB[i].size() == 0) -+ continue; -+ -+ switch(i) -+ { -+ case 0: styles += "border-left-width:"; break; -+ case 1: styles += "border-right-width:"; break; -+ case 2: styles += "border-top-width:"; break; -+ case 3: styles += "border-bottom-width:"; break; -+ } -+ -+ styles += sB[i]; -+ styles += ";"; -+ } -+ } -+ -+ if(iSCount[iSMaxIndx] != 3) -+ { -+ for(i = 0; i < 4; ++i) -+ { -+ if(i == iSMaxIndx || sS[i] == sS[iSMaxIndx] || sS[i].size() == 0) -+ continue; -+ -+ switch(i) -+ { -+ case 0: styles += "border-left-style:"; break; -+ case 1: styles += "border-right-style:"; break; -+ case 2: styles += "border-top-style:"; break; -+ case 3: styles += "border-bottom-style:"; break; -+ } -+ -+ styles += sS[i]; -+ styles += ";"; -+ } -+ } -+ -+ if(iCCount[iCMaxIndx] != 3) -+ { -+ for(i = 0; i < 4; ++i) -+ { -+ if(i == iCMaxIndx || sC[i] == sC[iCMaxIndx] || sC[i].size() == 0) -+ continue; -+ -+ switch(i) -+ { -+ case 0: styles += "border-left-color:"; break; -+ case 1: styles += "border-right-color:"; break; -+ case 2: styles += "border-top-color:"; break; -+ case 3: styles += "border-bottom-color:"; break; -+ } -+ -+ styles += sC[i]; -+ styles += ";"; -+ } -+ } -+ -+ const char * p = styles.utf8_str(); -+ UT_UTF8String s; -+ if(p[styles.byteLength()-1] == ';') -+ { -+ s.append(p, styles.byteLength()-1); -+ } -+ else -+ { -+ s = p; -+ } -+ -+ //m_utf8_1 = "table cellpadding=\""; -+ //m_utf8_1 += UT_UTF8String_sprintf ("%d\" border=\"%d", cellPadding, border); -+ m_utf8_1 = UT_UTF8String_sprintf ("table cellpadding=\"0\" border=\"%d\" style=\"", border); -+ m_utf8_1 += s; -+ m_utf8_1 += "\""; -+ -+ -+ unsigned int nCols = m_TableHelper.getNumCols (); -+ double totWidth = m_dPageWidthInches - m_dSecLeftMarginInches - m_dSecRightMarginInches; -+ -+ double colWidth = 100.0 / static_cast(nCols); -+ tagOpen (TT_TABLE, m_utf8_1); -+ _fillColWidthsVector(); -+ i = 0; -+ if(m_vecDWidths.getItemCount() > 0) -+ { -+ m_utf8_1 = "colgroup"; -+ tagOpen(TT_COLGROUP, m_utf8_1); -+ -+ for(i = 0; (i< nCols) && (i 0) -+ { -+ _fillColWidthsVector(); -+ _setCellWidthInches(); -+ } -+} -+ -+void s_HTML_Listener::_setCellWidthInches(void) -+{ -+ UT_sint32 left = m_TableHelper.getLeft (); -+ UT_sint32 right = m_TableHelper.getRight (); -+ double tot = 0; -+ UT_sint32 i =0; -+ -+ UT_ASSERT_HARMLESS((UT_sint32)m_vecDWidths.size() >= (right-1)); -+ -+ for(i=left; igetAttrProp (api, &pAP); -+ -+ if (bHaveProp && pAP) -+ { -+ const char * pszValue; -+ if(pAP->getProperty("height", pszValue)) -+ { -+ double dMM = UT_convertToDimension(pszValue, DIM_MM); -+ m_utf8_1 += UT_UTF8String_sprintf(";height:%.1fmm", dMM); -+ } -+ else -+ { -+ // we have a problem; need to set it to something, -+ // otherwise empty rows disappear from view -+ // ideally, we would want it set to the font size, but -+ // I do not think we can ascertain it at this stage. -+ m_utf8_1 += ";height:5mm"; -+ } -+ -+ } -+ } -+ -+ m_utf8_1 += "\""; -+ tagOpen (TT_TR, m_utf8_1); -+} -+ -+void s_HTML_Listener::_openCell (PT_AttrPropIndex api) -+{ -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ -+ m_bCellHasData = false; -+ -+ if (m_bFirstWrite) _openSection (api, 0); -+ -+ if (!m_bInSection) return; -+ -+ if (m_TableHelper.getNestDepth () < 1) _openTable(api); -+ -+ const PP_AttrProp * pAP = NULL; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ _setCellWidthInches(); -+ if (bHaveProp && pAP) -+ { -+ double dColSpacePT = 0; -+ double dRowSpacePT = 0; -+ const gchar * pszTableColSpacing = m_TableHelper.getTableProp ("table-col-spacing"); -+ const gchar * pszTableRowSpacing = m_TableHelper.getTableProp ("table-row-spacing"); -+ -+ if(pszTableColSpacing) -+ dColSpacePT = UT_convertToDimension(pszTableColSpacing, DIM_PT); -+ -+ if(pszTableRowSpacing) -+ dRowSpacePT = UT_convertToDimension(pszTableRowSpacing, DIM_PT); -+ -+ UT_UTF8String styles; -+ -+ if(dColSpacePT == dRowSpacePT) -+ { -+ styles += UT_UTF8String_sprintf("padding: %.2fpt", dColSpacePT); -+ } -+ else -+ { -+ styles += UT_UTF8String_sprintf("padding: %.2fpt %.2fpt", dRowSpacePT, dColSpacePT); -+ } -+ -+ UT_sint32 rowspan = m_TableHelper.getBot () - m_TableHelper.getTop (); -+ UT_sint32 colspan = m_TableHelper.getRight () - m_TableHelper.getLeft (); -+ -+ if (m_TableHelper.isNewRow()) // beginning of a new row -+ _openRow (api); -+ -+ const char * pszBgColor = m_TableHelper.getCellProp ("bgcolor"); -+ if (pszBgColor == NULL) -+ pszBgColor = m_TableHelper.getCellProp ("background-color"); -+ if (pszBgColor) -+ { -+ if (styles.byteLength ()) styles += ";"; -+ styles += "background-color:"; -+ -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBgColor); -+ if (hash) -+ styles += hash; -+ else -+ styles += pszBgColor; -+ } -+ -+ const char * pszBorderColor = NULL; -+ -+ pszBorderColor = m_TableHelper.getCellProp ("color"); -+ if (pszBorderColor) -+ { -+ if (styles.byteLength ()) styles += ";"; -+ styles += "color:"; -+ -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ styles += hash; -+ else -+ styles += pszBorderColor; -+ } -+ -+ // more often than not border attributes are same all around, so -+ // we want to use the border shortcut -+ // 0-L, 1-R, 2-T, 3-B -+ double dB[4] = {0.0,0.0,0.0,0.0}; -+ UT_UTF8String sB[4]; -+ UT_UTF8String sC[4]; -+ UT_UTF8String sS[4]; -+ -+ pszBorderColor = m_TableHelper.getCellProp ("bot-color"); -+ if (pszBorderColor) -+ { -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ sC[3] = hash; -+ else -+ sC[3] = pszBorderColor; -+ } -+ pszBorderColor = m_TableHelper.getCellProp ("left-color"); -+ if (pszBorderColor) -+ { -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ sC[0]= hash; -+ else -+ sC[0]= pszBorderColor; -+ } -+ pszBorderColor = m_TableHelper.getCellProp ("right-color"); -+ if (pszBorderColor) -+ { -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ sC[1] = hash; -+ else -+ sC[1] = pszBorderColor; -+ } -+ pszBorderColor = m_TableHelper.getCellProp ("top-color"); -+ if (pszBorderColor) -+ { -+ UT_HashColor color; -+ const char * hash = color.setHashIfValid (pszBorderColor); -+ if (hash) -+ sC[2] = hash; -+ else -+ sC[2] = pszBorderColor; -+ } -+ -+ const char * pszBorderStyle = NULL; -+ -+ pszBorderStyle = m_TableHelper.getCellProp ("bot-style"); -+ if (pszBorderStyle) -+ { -+ sS[3] = PP_PropertyMap::linestyle_for_CSS (pszBorderStyle); -+ } -+ pszBorderStyle = m_TableHelper.getCellProp ("left-style"); -+ if (pszBorderStyle) -+ { -+ sS[0]= PP_PropertyMap::linestyle_for_CSS (pszBorderStyle); -+ } -+ pszBorderStyle = m_TableHelper.getCellProp ("right-style"); -+ if (pszBorderStyle) -+ { -+ sS[1] = PP_PropertyMap::linestyle_for_CSS (pszBorderStyle); -+ } -+ pszBorderStyle = m_TableHelper.getCellProp ("top-style"); -+ if (pszBorderStyle) -+ { -+ sS[2] = PP_PropertyMap::linestyle_for_CSS (pszBorderStyle); -+ } -+ -+ const char * pszBorderWidth = NULL; -+ -+ pszBorderWidth = m_TableHelper.getCellProp ("bot-thickness"); -+ if (pszBorderWidth) -+ { -+ dB[3] = UT_convertToDimension(pszBorderWidth, DIM_PT); -+ sB[3] = UT_UTF8String_sprintf("%.2fpt", dB[3]); -+ } -+ pszBorderWidth = m_TableHelper.getCellProp ("left-thickness"); -+ if (pszBorderWidth) -+ { -+ dB[0] = UT_convertToDimension(pszBorderWidth, DIM_PT); -+ sB[0] = UT_UTF8String_sprintf("%.2fpt", dB[0]); -+ } -+ pszBorderWidth = m_TableHelper.getCellProp ("right-thickness"); -+ if (pszBorderWidth) -+ { -+ dB[1] = UT_convertToDimension(pszBorderWidth, DIM_PT); -+ sB[1] = UT_UTF8String_sprintf("%.2fpt", dB[1]); -+ } -+ pszBorderWidth = m_TableHelper.getCellProp ("top-thickness"); -+ if (pszBorderWidth) -+ { -+ dB[2] = UT_convertToDimension(pszBorderWidth, DIM_PT); -+ sB[2] = UT_UTF8String_sprintf("%.2fpt", dB[2]); -+ } -+ -+ // now we need to decide which attributes are to be used in the -+ // shortcut -+ UT_uint32 iBCount[4] = {0,0,0,0}; // 0 - L, 1 - R, 2 - T, 3 - B -+ UT_uint32 iCCount[4] = {0,0,0,0}; // 0 - L, 1 - R, 2 - T, 3 - B -+ UT_uint32 iSCount[4] = {0,0,0,0}; // 0 - L, 1 - R, 2 - T, 3 - B -+ UT_uint32 iBMaxIndx = 0, iCMaxIndx = 0, iSMaxIndx = 0; -+ UT_sint32 i = 0; -+ -+ for(i = 0; i < 4; ++i) -+ { -+ for(UT_sint32 j = i+1; j < 4; j++) -+ { -+ if(dB[i] == dB[j]) -+ { -+ iBCount[i]++; -+ iBCount[j]++; -+ } -+ } -+ } -+ -+ for(i = 1; i < 4; i++) -+ { -+ if(iBMaxIndx < iBCount[i]) -+ iBMaxIndx = i; -+ } -+ -+ for(i = 0; i < 4; ++i) -+ { -+ for(UT_sint32 j = i+1; j < 4; j++) -+ { -+ if(sC[i] == sC[j]) -+ { -+ iCCount[i]++; -+ iCCount[j]++; -+ } -+ } -+ } -+ -+ for(i = 1; i < 4; i++) -+ { -+ if(iCMaxIndx < iCCount[i]) -+ iCMaxIndx = i; -+ } -+ -+ for(i = 0; i < 4; ++i) -+ { -+ for(UT_sint32 j = i+1; j < 4; j++) -+ { -+ if(sS[i] == sS[j]) -+ { -+ iSCount[i]++; -+ iSCount[j]++; -+ } -+ } -+ } -+ -+ for(i = 1; i < 4; i++) -+ { -+ if(iSMaxIndx < iSCount[i]) -+ iSMaxIndx = i; -+ } -+ -+ if(styles.size() != 0) styles += ";"; -+ -+ styles += "border:"; -+ -+ if(sB[iBMaxIndx].size()) -+ { -+ styles += sB[iBMaxIndx]; -+ } -+ else -+ { -+ styles += "inherit"; -+ } -+ -+ styles += " "; -+ -+ if(sS[iSMaxIndx].size()) -+ { -+ styles += sS[iSMaxIndx]; -+ } -+ else -+ { -+ styles += "inherit"; -+ } -+ -+ styles += " "; -+ -+ if(sC[iCMaxIndx].size()) -+ { -+ styles += sC[iCMaxIndx]; -+ } -+ else -+ { -+ styles += "inherit"; -+ } -+ -+ if(styles.size() != 0) styles += ";"; -+ if(iBCount[iBMaxIndx] != 3) -+ { -+ for(i = 0; i < 4; ++i) -+ { -+ if((UT_uint32)i == iBMaxIndx || dB[i] == dB[iBMaxIndx]) -+ continue; -+ -+ switch(i) -+ { -+ case 0: styles += "border-left-width:"; break; -+ case 1: styles += "border-right-width:"; break; -+ case 2: styles += "border-top-width:"; break; -+ case 3: styles += "border-bottom-width:"; break; -+ } -+ -+ if(sB[i].size()) -+ styles += sB[i]; -+ else -+ styles += "inherit"; -+ -+ styles += ";"; -+ } -+ } -+ -+ if(iSCount[iSMaxIndx] != 3) -+ { -+ for(i = 0; i < 4; ++i) -+ { -+ if((UT_uint32)i == iSMaxIndx || sS[i] == sS[iSMaxIndx]) -+ continue; -+ -+ switch(i) -+ { -+ case 0: styles += "border-left-style:"; break; -+ case 1: styles += "border-right-style:"; break; -+ case 2: styles += "border-top-style:"; break; -+ case 3: styles += "border-bottom-style:"; break; -+ } -+ -+ if(sS[i].size()) -+ styles += sS[i]; -+ else -+ styles += "inherit"; -+ -+ styles += ";"; -+ } -+ } -+ -+ if(iCCount[iCMaxIndx] != 3) -+ { -+ for(i = 0; i < 4; ++i) -+ { -+ if((UT_uint32)i == iCMaxIndx || sC[i] == sC[iCMaxIndx]) -+ continue; -+ -+ switch(i) -+ { -+ case 0: styles += "border-left-color:"; break; -+ case 1: styles += "border-right-color:"; break; -+ case 2: styles += "border-top-color:"; break; -+ case 3: styles += "border-bottom-color:"; break; -+ } -+ -+ if(sC[i].size()) -+ styles += sC[i]; -+ else -+ styles += "inherit"; -+ -+ styles += ";"; -+ } -+ } -+ -+ const char * p = styles.utf8_str(); -+ UT_UTF8String s; -+ if(p[styles.byteLength()-1] == ';') -+ { -+ s.append(p, styles.byteLength()-1); -+ } -+ else -+ { -+ s = p; -+ } -+ -+ -+ m_utf8_1 = "td"; -+ -+ if (styles.byteLength ()) -+ { -+ m_utf8_1 += " style=\""; -+ m_utf8_1 += s; -+ m_utf8_1 += "\""; -+ } -+ -+ if (rowspan > 1) -+ { -+ m_utf8_1 += " rowspan=\""; -+ m_utf8_1 += UT_UTF8String_sprintf ("%d", rowspan); -+ m_utf8_1 += "\""; -+ } -+ if (colspan > 1) -+ { -+ m_utf8_1 += " colspan=\""; -+ m_utf8_1 += UT_UTF8String_sprintf ("%d", colspan); -+ m_utf8_1 += "\""; -+ } -+ tagOpen (TT_TD, m_utf8_1); -+ } -+} -+ -+void s_HTML_Listener::_closeCell () -+{ -+ if (m_TableHelper.getNestDepth () < 1) return; -+ -+ if(!m_bCellHasData) -+ { -+ // we need to insert a   to make sure that the cell will -+ // have its borders -+ // this is not necessary; the same effect can be achieved by -+ // setting "border-collapse:collapse;empty-cells:show" -+ UT_UTF8String s = " "; // This enables the table to be reimported in abi -+ tagRaw(s); -+ } -+ -+ /* The number of times _popUnendedStructures has to be used may be indicative of serious fundamental flows in the -+ current tag stack(s) implementation, an implementation which therefore is in dire need of an expert audit. -+ On the other hand, it may also be the necessary result of the already known shortcomings of our piecetable with -+ regard to the permission of unstruxed structures and unilateral struxes. -MG */ -+ _popUnendedStructures(); -+ -+ m_utf8_1 = "td"; -+ tagClose (TT_TD, m_utf8_1); -+} -+ -+#endif /* HTML_TABLES_SUPPORTED */ -+ -+ -+void s_HTML_Listener::_openPosImage (PT_AttrPropIndex api) -+{ -+ const PP_AttrProp * pAP = NULL; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ if (!bHaveProp || (pAP == 0)) return; -+ -+ const gchar * pszDataID = NULL; -+ if(pAP->getAttribute(PT_STRUX_IMAGE_DATAID, (const gchar *&)pszDataID) && pszDataID) -+ _handleImage(pAP,pszDataID,true); -+ -+} -+ -+void s_HTML_Listener::_openTextBox (PT_AttrPropIndex api) -+{ -+ const PP_AttrProp * pAP = NULL; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ if (!bHaveProp || (pAP == 0)) return; -+ const gchar * tempProp = 0; -+ -+ if(m_bInTextBox) -+ _closeTextBox(); // Fortunately for the html exporter, abi does not permit nested frames. -+ -+ if(m_iListDepth) -+ listPopToDepth(0); // AbiWord does not support textboxes in LIs, neither do we. -+ -+ m_bInFrame = true; -+ m_bInTextBox = true; // See comment by declaration -+ /* --- Copied from closeSection --- */ -+ // TODO: Extract me into closePseudoSection. -+ if (m_bInBlock) -+ _closeTag (); // We need to investigate the tag stack usage of this, and whether or not we really would rather specify the tag in all cases. -+ -+ // Need to investigate whether we can safely uncomment this without undoing heading work, or any other kind using unended structures like lists. -+ // _popUnendedStructures(); // Close lists, and possibly other stuff. Even if it theoretically can span sections, we run a high risk of corrupting the document. -+ -+ if (m_bInSection && (tagTop () == TT_DIV)) -+ { -+ m_utf8_1 = "div"; -+ tagClose (TT_DIV, m_utf8_1); -+ } -+ /* --- */ -+ m_utf8_1 = "div style=\""; // We represent the box with a div (block) -+ -+ // TODO: Enum frame properties (and in any case where props equal their css counterparts) separately -+ // TODO: so here (and places like here) you can just iterate through it getting the prop and setting it. -+ // TODO: Actually, you wouldn't have to limit it to where the props were identical, just have -+ // TODO: { abiprop, cssprop }. It would still require that the units used for both specs be compatible. -+ // -+ // TODO: Take care of padding as well. -+ const gchar * propNames[20] = {"bot-thickness","border-bottom-width", -+ "top-thickness","border-top-width", -+ "right-thickness","border-right-width", -+ "left-thickness","border-left-width", -+ "bot-color","border-bottom-color", -+ "top-color","border-top-color", -+ "right-color","border-right-color", -+ "left-color","border-left-color", -+ "background-color","background-color", -+ NULL,NULL}; // [AbiWord property name, CSS21 property name] -+ for(unsigned short int propIdx = 0; propIdx < 18; propIdx += 2) -+ { -+ if(pAP->getProperty(propNames[propIdx], tempProp)) // If we successfully retrieve a value (IOW, it's defined) -+ { -+ m_utf8_1 += propNames[propIdx + 1]; // Add the property name of the CSS equivalent -+ m_utf8_1 += ": "; // Don't ask (: -+ if(strstr(propNames[propIdx + 1], "color")) m_utf8_1 += "#"; // AbiWord tends to store colors as hex, which must be prefixed by # in CSS -+ m_utf8_1 += tempProp; // Add the value -+ m_utf8_1 += "; "; // Terminate the property -+ } -+ } -+ -+ //pAP->getProperty("bot-style", tempProp); // Get the bottom border style -+ //<...> -+ // We don't do this right now because we don't support multiple styles right now. -+ // See bug 7935. Until we support multiple styles, it is sufficient to set all solid. -+ m_utf8_1 += " border: solid;"; -+ -+ // This might need to be updated for textbox (and wrapped-image?) changes that -+ // occured in 2.3. -+ pAP->getProperty("wrap-mode", tempProp); // Get the wrap mode -+ if(!strcmp(tempProp, "wrapped-both")) -+ m_utf8_1 += " clear: none;"; -+ else if(!strcmp(tempProp, "wrapped-left")) -+ m_utf8_1 += " clear: right;"; -+ else if(!strcmp(tempProp, "wrapped-right")) -+ m_utf8_1 += " clear: left;"; -+ else if(!strcmp(tempProp, "above-text")) -+ m_utf8_1 += " clear: none; z-index: 999;"; -+ -+ m_utf8_1 += "\""; -+ -+ tagOpen(TT_DIV, m_utf8_1); -+ -+ return; -+} -+ -+void s_HTML_Listener::_closeTextBox () -+{ -+ // We don't need to close the block ourselves because _closeSection does it for us. -+ /* --- */ -+ // TODO: Extract me into closePseudoSection -+ // We cannot use _closeSection(), we're not actually in a section. -+ if (m_bInBlock) -+ _closeTag (); // We need to investigate the tag stack usage of this, and whether or not we really would rather specify the tag in all cases. -+ -+ // Need to investigate whether we can safely uncomment this without undoing heading work, or any other kind using unended structures like lists. -+ // _popUnendedStructures(); // Close lists, and possibly other stuff. Even if it theoretically can span sections, we run a high risk of corrupting the document. -+ -+ if ((tagTop () == TT_DIV)) -+ { -+ m_utf8_1 = "div"; -+ tagClose (TT_DIV, m_utf8_1); -+ } -+ else -+ { -+ UT_DEBUGMSG(("WARNING: Something gone awry with this textbox \n")); -+ } -+ /* --- */ -+ // Fortunately for us, abi does not permit nested frames yet. -+ m_bInFrame = false; -+ m_bInTextBox = false; -+} -+ -+void s_HTML_Listener::_outputData (const UT_UCSChar * data, UT_uint32 length) -+{ -+ if (!m_bInBlock) return; -+ -+ m_utf8_1 = ""; -+ -+ bool prev_space = false; -+ const UT_UCSChar * ucs_ptr = data; -+ for (UT_uint32 i = 0; i < length; i++) -+ { -+ bool space = false; -+ -+ switch (*ucs_ptr) -+ { -+ case UCS_FF: // page break, convert to line break -+ case UCS_LF: -+ /* LF -- representing a Forced-Line-Break -+ */ -+ if (m_utf8_1.byteLength ()) textTrusted (m_utf8_1); -+ m_utf8_1 = "br"; -+ tagOpenClose (m_utf8_1, get_HTML4 (), ws_None); -+ m_utf8_1 = ""; -+ break; -+ -+ case UCS_LDBLQUOTE: -+ m_utf8_1 += "“"; -+ m_bCellHasData = true; -+ break; -+ -+ case UCS_RDBLQUOTE: -+ m_utf8_1 += "”"; -+ m_bCellHasData = true; -+ break; -+ -+ case UCS_LQUOTE: -+ m_utf8_1 += "‘"; -+ m_bCellHasData = true; -+ break; -+ -+ case UCS_RQUOTE: -+ m_utf8_1 += "’"; -+ m_bCellHasData = true; -+ break; -+ -+ case UCS_EN_DASH: -+ m_utf8_1 += "–"; -+ m_bCellHasData = true; -+ break; -+ -+ case UCS_EM_DASH: -+ m_utf8_1 += "—"; -+ m_bCellHasData = true; -+ break; -+ -+ default: -+ if ((*ucs_ptr & 0x007f) == *ucs_ptr) // ASCII -+ { -+ m_bCellHasData = true; -+ char c = static_cast(*ucs_ptr & 0x007f); -+ -+ if (isspace (static_cast(static_cast(c)))) -+ { -+ if (prev_space || (length == 1)) -+ m_utf8_1 += " "; -+ else -+#ifdef HTML_UCS4 -+ m_utf8_1.appendUCS4 (ucs_ptr, 1); -+#else -+ m_utf8_1.append (ucs_ptr, 1); -+#endif -+ space = true; -+ } -+ else switch (c) -+ { -+ case '<': -+ m_utf8_1 += "<"; -+ break; -+ case '>': -+ m_utf8_1 += ">"; -+ break; -+ case '&': -+ m_utf8_1 += "&"; -+ break; -+ default: -+#ifdef HTML_UCS4 -+ m_utf8_1.appendUCS4 (ucs_ptr, 1); -+#else -+ m_utf8_1.append (ucs_ptr, 1); -+#endif -+ break; -+ } -+ } -+#ifdef HTML_UCS4 -+ else m_utf8_1.appendUCS4 (ucs_ptr, 1); // !ASCII, just append... ?? -+#else -+ else m_utf8_1.append (ucs_ptr, 1); // !ASCII, just append... ?? -+#endif -+ break; -+ } -+ prev_space = space; -+ ucs_ptr++; -+ } -+ if (m_utf8_1.byteLength ()) textTrusted (m_utf8_1); -+} -+ -+s_HTML_Listener::s_HTML_Listener (PD_Document * pDocument, IE_Exp_HTML * pie, bool bClipBoard, -+ bool bTemplateBody, const XAP_Exp_HTMLOptions * exp_opt, -+ s_StyleTree * style_tree, -+ UT_UTF8String & linkCSS, -+ UT_UTF8String & title) : -+ m_pDocument (pDocument), -+ m_apiLastSpan(0), -+ m_pie(pie), -+ m_bClipBoard(bClipBoard), -+ m_bTemplateBody(bTemplateBody), -+ m_exp_opt(exp_opt), -+ m_style_tree(style_tree), -+ m_bInSection(false), -+ m_bInFrame(false), -+ m_bInTextBox(false), -+ m_bInTOC(false), -+ m_bInBlock(false), -+ m_bInSpan(false), -+ m_bNextIsSpace(false), -+ m_bWroteText(false), -+ m_bFirstWrite(true), -+ m_bQuotedPrintable(false), -+ m_bHaveHeader(false), -+ m_bHaveFooter(false), -+#ifdef HTML_TABLES_SUPPORTED -+ m_TableHelper(pDocument), -+#endif /* HTML_TABLES_SUPPORTED */ -+ m_iBlockType(0), -+ m_iListDepth(0), -+ m_iImgCnt(0), -+ m_StyleTreeInline(0), -+ m_StyleTreeBlock(0), -+ m_StyleTreeBody(0), -+ m_pAPStyles(0), -+ m_styleIndent(0), -+ m_fdCSS(0), -+ m_bIgnoreTillEnd(false), -+ m_bIgnoreTillNextSection(false), -+ m_iEmbedStartPos(0), -+ m_dPageWidthInches(0.0), -+ m_dSecLeftMarginInches(0.0), -+ m_dSecRightMarginInches(0.0), -+ m_dCellWidthInches(0.0), -+ m_sLinkCSS(linkCSS), -+ m_sTitle(title), -+ m_iOutputLen(0), -+ m_bCellHasData(true), // we are not in cell to start with, set to true -+ m_toc(0), -+ m_heading_count(0) -+{ -+ m_toc = new IE_TOCHelper (m_pDocument); -+ m_StyleTreeBody = m_style_tree->find ("Normal"); -+} -+ -+s_HTML_Listener::~s_HTML_Listener() -+{ -+ UT_DEBUGMSG(("deleteing lisnter %x \n",this)); -+ _closeTag (); -+ -+ listPopToDepth (0); -+ -+ _closeSection (); -+ -+ _outputEnd (); -+ -+ UT_VECTOR_PURGEALL(double *,m_vecDWidths); -+ DELETEP(m_toc); -+} -+ -+/* dataid is the raw string with the data ID -+ * imagedir is the name of the directory in which we'll write the image -+ * filename is the name of the file to which we'll write the image -+ * url is the URL which we'll use -+ */ -+void s_HTML_Listener::_writeImage (const UT_ByteBuf * pByteBuf, -+ const UT_UTF8String & imagedir, -+ const UT_UTF8String & filename) -+{ -+ /* hmm, bit lazy this - attempt to create directory whether or not -+ * it exists already... if it does, well hey. if this fails to -+ * create a directory then fopen() will fail as well, so no biggie -+ */ -+ UT_go_directory_create(imagedir.utf8_str(), 0750, NULL); -+ -+ UT_UTF8String path(imagedir); -+ path += "/"; -+ path += filename; -+ -+ GsfOutput * out = UT_go_file_create (path.utf8_str (), NULL); -+ if (out) -+ { -+ gsf_output_write (out, pByteBuf->getLength (), (const guint8*)pByteBuf->getPointer (0)); -+ gsf_output_close (out); -+ g_object_unref (G_OBJECT (out)); -+ } -+} -+ -+void s_HTML_Listener::_writeImageBase64 (const UT_ByteBuf * pByteBuf) -+{ -+ char buffer[75]; -+ char * bufptr = 0; -+ size_t buflen; -+ size_t imglen = pByteBuf->getLength (); -+ const char * imgptr = reinterpret_cast(pByteBuf->getPointer (0)); -+ -+ buffer[0] = '\r'; -+ buffer[1] = '\n'; -+ -+ while (imglen) -+ { -+ buflen = 72; -+ bufptr = buffer + 2; -+ -+ UT_UTF8_Base64Encode (bufptr, buflen, imgptr, imglen); -+ -+ *bufptr = 0; -+ -+ m_utf8_1 = buffer; -+ textTrusted (m_utf8_1); -+ } -+} -+ -+void s_HTML_Listener::_handleEmbedded (PT_AttrPropIndex api) -+{ -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ -+ if (!bHaveProp || (pAP == 0)) return; -+ -+ const gchar * szDataID = 0; -+ pAP->getAttribute ("dataid", szDataID); -+ -+ if (szDataID == 0) return; -+ -+ UT_UTF8String imgDataID("snapshot-png-"); -+ imgDataID += szDataID; -+ -+ // Code to export the embedded object as an -+ // with an inside it, as a rendering fallback -+ // http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#h-13.3 -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ -+ const char * szName = 0; -+ const char * szMimeType = 0; -+ -+ const UT_ByteBuf * pByteBuf = 0; -+ -+ UT_uint32 k = 0; -+ while (m_pDocument->enumDataItems (k, 0, &szName, &pByteBuf, reinterpret_cast(&szMimeType))) -+ { -+ k++; -+ if (szName == 0) continue; -+ if (strcmp (szDataID, szName) == 0) break; -+ -+ szName = 0; -+ szMimeType = 0; -+ pByteBuf = 0; -+ } -+ if ((pByteBuf == 0) || (szMimeType == 0)) return; // ?? -+ -+ -+ const char * dataid = UT_basename (static_cast(szDataID)); -+ -+ const char * suffix = dataid + strlen (dataid); -+ const char * suffid = suffix; -+ const char * ptr = 0; -+ -+ /* Question: What does the DataID look like for objects pasted -+ * from the clipboard? -+ */ -+ ptr = suffix; -+ while (ptr > dataid) -+ if (*--ptr == '_') -+ { -+ suffix = ptr; -+ suffid = suffix; -+ break; -+ } -+ ptr = suffix; -+ while (ptr > dataid) -+ if (*--ptr == '.') -+ { -+ suffix = ptr; -+ // break; -+ } -+ if (dataid == suffix) return; -+ -+ char * base_name = UT_go_basename_from_uri (m_pie->getFileName ()); -+ -+ /* hmm; who knows what locale the system uses -+ */ -+ UT_UTF8String objectbasedir = "clipboard"; -+ if (base_name) -+ objectbasedir = base_name; -+ objectbasedir += "_files"; -+ UT_UTF8String objectdir = m_pie->getFileName (); -+ objectdir += "_files"; -+ -+ UT_UTF8String filename(dataid,suffix-dataid); -+ filename += suffid; -+ filename += ".obj"; -+ -+ g_free (base_name); -+ -+ UT_UTF8String url; -+ -+ url += s_string_to_url (objectbasedir); -+ url += "/"; -+ url += s_string_to_url (filename); -+ -+ if (get_Multipart ()) -+ { -+ UT_UTF8String * save_url = new UT_UTF8String(url); -+ if (save_url == 0) return; -+ -+ if (!m_SavedURLs.insert (szDataID, save_url)) // arg. failed. skip object -+ { -+ DELETEP(save_url); -+ return; -+ } -+ } -+ -+ /* szDataID is the raw string with the data ID -+ * objectdir is the name of the directory in which we'll write the object -+ * filename is the name of the file to which we'll write the object -+ * url is the URL which we'll use -+ */ -+ if (!get_Embed_Images () && !get_Multipart ()) -+ { -+ _writeImage (pByteBuf, objectdir, filename); -+ } -+ -+ m_utf8_1 = "object"; -+ -+ const gchar * szWidth = 0; -+ -+ pAP->getProperty ("width", szWidth); -+ -+ double dWidth = UT_convertToInches(szWidth); -+ double total = 0; -+ if(m_TableHelper.getNestDepth() > 0) -+ { -+ total = m_dCellWidthInches; -+ } -+ else -+ { -+ total = m_dPageWidthInches - m_dSecLeftMarginInches - m_dSecRightMarginInches; -+ } -+ double percent = 100.0*dWidth/total; -+ if(percent > 100.) -+ { -+ percent = 100.0; -+ } -+ UT_UTF8String tmp; -+ UT_DEBUGMSG(("Width of Object %s \n",szWidth ? szWidth : "(null)")); -+ -+ UT_sint32 iObjectWidth, iObjectHeight; -+ UT_PNG_getDimensions(pByteBuf, iObjectWidth, iObjectHeight); -+ UT_DEBUGMSG(("Real object dimensions: (%d x %d)\n", iObjectWidth, iObjectHeight)); -+ -+ if (szWidth) -+ { -+ m_utf8_1 += " width=\""; -+ if (get_Scale_Units()) -+ { -+ UT_sint32 iPercent = (UT_sint32)(percent + 0.5); -+ tmp = UT_UTF8String_sprintf("%d%%",iPercent); -+ } else // Abi stores the orig file, but abs or unitless must be true to dims set in abi -+ { -+ double dMM = UT_convertToDimension(szWidth, DIM_MM); -+ tmp = UT_UTF8String_sprintf("%.1fmm",dMM); -+ } -+ m_utf8_1 += tmp; -+ m_utf8_1 += "\""; -+ } -+ -+ m_utf8_1 += UT_UTF8String_sprintf(" type=\"%s\"", szMimeType); -+ -+ m_tagStack.push (TT_OBJECT); -+ if (!get_Embed_Images () || get_Multipart ()) -+ { -+ m_utf8_1 += " data=\""; -+ m_utf8_1 += url; -+ m_utf8_1 += "\""; -+ -+ tagOpenBroken (m_utf8_1, ws_None); -+ -+ m_utf8_1 = ""; -+ tagCloseBroken (m_utf8_1, true, ws_None); -+ } -+ else -+ { -+ m_utf8_1 += UT_UTF8String_sprintf(" data=\"data:%s;base64,", szMimeType); -+ tagOpenBroken (m_utf8_1, ws_None); -+ -+ _writeImageBase64 (pByteBuf); -+ -+ m_utf8_1 = "\""; -+ tagCloseBroken (m_utf8_1, true, ws_None); -+ } -+ -+ // embed an version of the object, as a rendering fallback -+ _handleImage (pAP, imgDataID.utf8_str(),false); -+ -+ m_utf8_1 = "object"; -+ tagClose(TT_OBJECT, m_utf8_1); -+} -+ -+void s_HTML_Listener::_handleImage (PT_AttrPropIndex api) -+{ -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ -+ if (!bHaveProp || (pAP == 0)) return; -+ -+ const gchar * szDataID = 0; -+ pAP->getAttribute ("dataid", szDataID); -+ -+ if (szDataID == 0) return; -+ -+ _handleImage (pAP, szDataID,false); -+} -+ -+void s_HTML_Listener::_handleImage (const PP_AttrProp * pAP, const char * szDataID, bool bIsPositioned) -+{ -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ -+ const char * szName = 0; -+ const char * szMimeType = 0; -+ -+ const UT_ByteBuf * pByteBuf = 0; -+ -+ UT_uint32 k = 0; -+ while (m_pDocument->enumDataItems (k, 0, &szName, &pByteBuf, reinterpret_cast(&szMimeType))) -+ { -+ k++; -+ if (szName == 0) continue; -+ if (strcmp (szDataID, szName) == 0) break; -+ -+ szName = 0; -+ szMimeType = 0; -+ pByteBuf = 0; -+ } -+ if ((pByteBuf == 0) || (szMimeType == 0)) return; // ?? -+ -+ if (strcmp (szMimeType, "image/png") != 0) -+ { -+ UT_DEBUGMSG(("Object not of MIME type image/png - ignoring...\n")); -+ return; -+ } -+ -+ const char * dataid = UT_basename (static_cast(szDataID)); -+ -+ const char * suffix = dataid + strlen (dataid); -+ const char * suffid = suffix; -+ const char * ptr = 0; -+ -+ /* Question: What does the DataID look like for images pasted -+ * from the clipboard? -+ */ -+ ptr = suffix; -+ while (ptr > dataid) -+ if (*--ptr == '_') -+ { -+ suffix = ptr; -+ suffid = suffix; -+ break; -+ } -+ ptr = suffix; -+ while (ptr > dataid) -+ if (*--ptr == '.') -+ { -+ suffix = ptr; -+ // break; -+ } -+ if (dataid == suffix) return; -+ -+ char * base_name = UT_go_basename_from_uri (m_pie->getFileName ()); -+ -+ /* hmm; who knows what locale the system uses -+ */ -+ UT_UTF8String imagebasedir = "clipboard"; -+ if (base_name) -+ imagebasedir = base_name; -+ imagebasedir += "_files"; -+ UT_UTF8String imagedir = m_pie->getFileName (); -+ imagedir += "_files"; -+ -+ UT_UTF8String filename(dataid,suffix-dataid); -+ filename += suffid; -+ filename += ".png"; -+ -+ g_free (base_name); -+ -+ UT_UTF8String url; -+ -+ url += s_string_to_url (imagebasedir); -+ url += "/"; -+ url += s_string_to_url (filename); -+ -+ if (get_Multipart ()) -+ { -+ UT_UTF8String * save_url = new UT_UTF8String(url); -+ if (save_url == 0) return; -+ -+ if (!m_SavedURLs.insert (szDataID, save_url)) // arg. failed. skip image -+ { -+ DELETEP(save_url); -+ return; -+ } -+ } -+ -+ /* szDataID is the raw string with the data ID -+ * imagedir is the name of the directory in which we'll write the image -+ * filename is the name of the file to which we'll write the image -+ * url is the URL which we'll use -+ */ -+ if (!get_Embed_Images () && !get_Multipart ()) -+ { -+ _writeImage (pByteBuf, imagedir, filename); -+ } -+ m_utf8_1 = "img"; -+ if(bIsPositioned) -+ { -+ const gchar * szXPos = NULL; -+ UT_sint32 ixPos = 0; -+ if(pAP->getProperty("xpos",szXPos)) -+ { -+ ixPos= UT_convertToLogicalUnits(szXPos); -+ } -+ else if(pAP->getProperty("frame-col-xpos",szXPos)) -+ { -+ ixPos= UT_convertToLogicalUnits(szXPos); -+ } -+ else if(pAP->getProperty("frame-page-xpos",szXPos)) -+ { -+ ixPos= UT_convertToLogicalUnits(szXPos); -+ } -+ if(ixPos > UT_convertToLogicalUnits("1.0in")) -+ { -+ m_utf8_1 += " align=\"right\" "; -+ } -+ else -+ { -+ m_utf8_1 += " align=\"left\" "; -+ } -+ } -+ const gchar * szWidth = 0; -+ if(!bIsPositioned) -+ pAP->getProperty ("width", szWidth); -+ else -+ pAP->getProperty ("frame-width", szWidth); -+ -+ double dWidth = UT_convertToInches(szWidth); -+ double total = 0; -+ if(m_TableHelper.getNestDepth() > 0) -+ { -+ total = m_dCellWidthInches; -+ } -+ else -+ { -+ total = m_dPageWidthInches - m_dSecLeftMarginInches - m_dSecRightMarginInches; -+ } -+ double percent = 100.0*dWidth/total; -+ if(percent > 100.) -+ { -+ percent = 100.0; -+ } -+ UT_UTF8String tmp, escape; -+ UT_DEBUGMSG(("Width of Image %s \n",szWidth ? szWidth : "(null)")); -+ -+ UT_sint32 iImageWidth, iImageHeight; -+ UT_PNG_getDimensions(pByteBuf, iImageWidth, iImageHeight); -+ UT_DEBUGMSG(("Real image dimensions: (%d x %d)\n", iImageWidth, iImageHeight)); -+ -+ if (szWidth) -+ { -+ m_utf8_1 += " style=\"width:"; -+ if (get_Scale_Units()) -+ { -+ UT_sint32 iPercent = (UT_sint32)(percent + 0.5); -+ tmp = UT_UTF8String_sprintf("%d%%",iPercent); -+ } else // Abi stores the orig file, but abs or unitless must be true to dims set in abi -+ { -+ double dMM = UT_convertToDimension(szWidth, DIM_MM); -+ tmp = UT_UTF8String_sprintf("%.1fmm",dMM); -+ } -+ m_utf8_1 += tmp; -+ m_utf8_1 += "\""; -+ } -+ -+ const gchar * szTitle = 0; -+ pAP->getAttribute ("title", szTitle); -+ if (szTitle) { -+ escape = szTitle; -+ m_utf8_1 += " title=\""; -+ m_utf8_1 += escape.escapeXML(); -+ m_utf8_1 += "\""; -+ escape.clear(); -+ } -+ -+ const gchar * szAlt = 0; -+ pAP->getAttribute ("alt", szAlt); -+ m_utf8_1 += " alt=\""; -+ if (szAlt) { -+ escape = szAlt; -+ m_utf8_1 += escape.escapeXML(); -+ } -+ m_utf8_1 += "\""; -+ -+ const gchar * szLang = 0; -+ pAP->getProperty ("lang", szLang); -+ if (szLang) { -+ if (!get_HTML4 ()) { -+ // we want to emit xml:lang in addition to lang -+ m_utf8_1 += " xml:lang=\""; -+ m_utf8_1 += szLang; -+ m_utf8_1 += "\""; -+ } -+ -+ m_utf8_1 += " lang=\""; -+ m_utf8_1 += szLang; -+ m_utf8_1 += "\""; -+ } -+ -+ if (!get_Embed_Images () || get_Multipart ()) -+ { -+ m_utf8_1 += " src=\""; -+ m_utf8_1 += url; -+ m_utf8_1 += "\""; -+ -+ tagOpenClose (m_utf8_1, get_HTML4 (), ws_None); -+ -+ return; -+ } -+ -+ m_utf8_1 += " src=\"data:image/png;base64,"; -+ tagOpenBroken (m_utf8_1, ws_None); -+ -+ _writeImageBase64 (pByteBuf); -+ -+ m_utf8_1 = "\""; -+ tagCloseBroken (m_utf8_1, get_HTML4 (), ws_None); -+} -+ -+void s_HTML_Listener::_handlePendingImages () -+{ -+ UT_GenericStringMap::UT_Cursor cursor (&m_SavedURLs); -+ -+ const UT_UTF8String * val = 0; -+ for (val = cursor.first (); cursor.is_valid (); val = cursor.next ()) -+ { -+ const char * dataid = cursor.key().c_str (); -+ -+ const UT_UTF8String * saved_url = val; -+ UT_UTF8String * url = const_cast(saved_url); -+ -+ const char * szName = 0; -+ const char * szMimeType = 0; -+ -+ const UT_ByteBuf * pByteBuf = 0; -+ -+ UT_uint32 k = 0; -+ while (m_pDocument->enumDataItems (k, 0, &szName, &pByteBuf, reinterpret_cast(&szMimeType))) -+ { -+ k++; -+ if (szName == 0) continue; -+ if (strcmp (dataid, szName) == 0) break; -+ -+ szName = 0; -+ szMimeType = 0; -+ pByteBuf = 0; -+ } -+ if (pByteBuf) // this should always be found, but just in case... -+ { -+ multiBoundary (); -+ -+ m_utf8_1 = "image/png"; -+ multiField ("Content-Type", m_utf8_1); -+ -+ m_utf8_1 = "base64"; -+ multiField ("Content-Transfer-Encoding", m_utf8_1); -+ -+ multiField ("Content-Location", *url); -+ -+ _writeImageBase64 (pByteBuf); -+ -+ multiBreak (); -+ } -+ DELETEP(url); -+ } -+ m_SavedURLs.clear (); -+} -+ -+void s_HTML_Listener::_handleField (const PX_ChangeRecord_Object * pcro, -+ PT_AttrPropIndex api) -+{ -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ -+ if (!bHaveProp || (pAP == 0)) return; -+ -+ const gchar * szType = 0; -+ pAP->getAttribute ("type", szType); -+ -+ if (szType == 0) return; -+ -+ fd_Field * field = pcro->getField (); -+ -+ m_pie->populateFields (); -+ -+ if (strcmp (szType, "list_label") != 0) -+ { -+ // TODO: Text styles? (maybe not) -+ // TODO: Line before footnotes? Or use the table as in embedded target idea? -+ // See also: abi bug 7612 -+ // TODO: Optional: -+ // TODO: Embedded target for footnote linking (frame adjusts on the footnotes when ref clicked). -+ -+ m_utf8_1 = "span"; -+ -+ // TODO: branch out to get the format of the refs/anchors correct. -+ if ((strcmp (szType, "footnote_anchor") == 0) || -+ (strcmp (szType, "endnote_anchor") == 0) || -+ (strcmp (szType, "footnote_ref") == 0) || -+ (strcmp (szType, "endnote_ref") == 0)) -+ { -+ const gchar * szA_Style = 0; -+ bool have_style = pAP->getAttribute (PT_STYLE_ATTRIBUTE_NAME, szA_Style); -+ if (have_style) -+ { -+ const s_StyleTree * tree = 0; -+ tree = m_style_tree->find (szA_Style); -+ if (tree) -+ { -+ if (tree->class_list().byteLength ()) -+ { -+ UT_UTF8String escape = tree->class_name (); -+ m_utf8_1 += " class=\""; -+ m_utf8_1 += escape.escapeXML(); -+ m_utf8_1 += "\""; -+ } -+ } -+ } -+ else -+ { -+ m_utf8_1 += " class=\"ABI_FIELD_"; -+ m_utf8_1 += szType; -+ m_utf8_1 += "\""; -+ } -+ const gchar * szA_Props = 0; -+ bool have_props = pAP->getAttribute (PT_PROPS_ATTRIBUTE_NAME, szA_Props); -+ if(have_props) -+ { -+ m_utf8_1 += " style=\""; -+ m_utf8_1 += szA_Props; -+ m_utf8_1 += "\""; -+ } -+ -+ gchar * szTypeCpy = new gchar[strlen(szType) + 2]; -+ strncpy(szTypeCpy, szType, strlen(szType)+1); -+ const gchar * noteToken = (gchar *)strtok((char *)szTypeCpy, "_"); -+ gchar * idAttr = new gchar[strlen(noteToken) + 4]; -+ strncpy(idAttr, noteToken, strlen(noteToken)+1); -+ const gchar * partToken = (gchar *)strtok(NULL, "_"); -+ const gchar * szID = 0; -+ const gchar * szNoteNumInit = 0; -+ UT_uint32 noteNumInit = 1; -+ -+ UT_UTF8String notePNString; -+ UT_UTF8String notePLString; -+ UT_UTF8String notePIDString; -+ -+ // Take into account document-*note-initial -+ // This block preps for getting a document-level property. -+ PT_AttrPropIndex docApi = m_pDocument->getAttrPropIndex(); -+ const PP_AttrProp * pDAP = NULL; -+ m_pDocument->getAttrProp (docApi, &pDAP); -+ if(!strcmp(noteToken, "footnote") && pDAP->getProperty("document-footnote-initial", szNoteNumInit)) -+ noteNumInit = atoi(szNoteNumInit); -+ else if(!strcmp(noteToken, "endnote") && pDAP->getProperty("document-endnote-initial", szNoteNumInit)) -+ noteNumInit = atoi(szNoteNumInit); -+ -+ UT_uint32 ID = 0; -+ if(pAP->getAttribute (strcat(idAttr, "-id"), szID) && szID) -+ ID = atoi(szID); -+ -+ UT_UTF8String_sprintf(notePIDString, " id=\"%s_%s-%d\"", noteToken, partToken, (ID + noteNumInit)); -+ m_utf8_1 += notePIDString; -+ tagOpen (TT_SPAN, m_utf8_1, ws_None); -+ m_utf8_1 = "a"; -+ -+ const char *hrefPartAtom = (strcmp(partToken, "anchor") ? "anchor" : "ref"); -+ -+ UT_UTF8String_sprintf(notePLString, " href=\"#%s_%s-%d\"", noteToken, hrefPartAtom, (ID + noteNumInit)); -+ m_utf8_1 += notePLString; -+ tagOpen (TT_A, m_utf8_1, ws_None); -+ UT_UTF8String_sprintf(notePNString, "%d", (ID + noteNumInit)); -+ m_pie->write (notePNString.utf8_str (), notePNString.byteLength ()); -+ textUntrusted (field->getValue ()); -+ m_utf8_1 = "a"; -+ tagClose (TT_A, m_utf8_1, ws_None); -+ DELETEPV(idAttr); -+ DELETEPV(szTypeCpy); -+ } -+ else -+ { -+ m_utf8_1 = "span"; -+ // TODO: Find out if we can change this back to just getting the style from the document, -+ // which is what is done with notes. -+ m_utf8_1 += " class=\"ABI_FIELD_"; -+ m_utf8_1 += szType; -+ m_utf8_1 += "\""; -+ tagOpen (TT_SPAN, m_utf8_1, ws_None); -+ textUntrusted (field->getValue ()); -+ } -+ -+ m_utf8_1 = "span"; -+ tagClose (TT_SPAN, m_utf8_1, ws_None); -+ } -+} -+ -+void s_HTML_Listener::_handleHyperlink (PT_AttrPropIndex api) -+{ -+ m_utf8_1 = "a"; -+ -+ if (tagTop () == TT_A) -+ { -+ tagClose (TT_A, m_utf8_1, ws_None); -+ } -+ -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = (api ? (m_pDocument->getAttrProp (api, &pAP)) : false); -+ -+ if (!bHaveProp || (pAP == 0)) return; -+ -+ const gchar * szHRef = 0; -+ pAP->getAttribute ("xlink:href", szHRef); -+ -+ if (szHRef) // trust this to be a valid URL?? -+ { -+ UT_UTF8String url = szHRef; -+ url.escapeURL(); -+ -+ m_utf8_1 += " href=\""; -+ m_utf8_1 += url; -+ m_utf8_1 += "\""; -+ -+ tagOpen (TT_A, m_utf8_1, ws_None); -+ } -+} -+ -+void s_HTML_Listener::_handleBookmark (PT_AttrPropIndex api) -+{ -+ m_utf8_1 = "a"; -+ -+ if (tagTop () == TT_A) -+ { -+ tagClose (TT_A, m_utf8_1, ws_None); -+ } -+ -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = (api ? (m_pDocument->getAttrProp (api, &pAP)) : false); -+ -+ if (!bHaveProp || (pAP == 0)) return; -+ -+ const gchar * szType = 0; -+ pAP->getAttribute ("type", szType); -+ -+ if (szType == 0) return; // ?? -+ -+ if (g_ascii_strcasecmp (szType, "start") == 0) -+ { -+ const gchar * szName = 0; -+ pAP->getAttribute ("name", szName); -+ -+ if (szName) -+ { -+ UT_UTF8String escape = szName; -+ escape.escapeXML(); -+ -+ m_utf8_1 += " name=\""; -+ m_utf8_1 += escape; -+ m_utf8_1 += "\""; -+ -+ if (!get_HTML4 ()) -+ { -+ m_utf8_1 += " id=\""; -+ m_utf8_1 += escape; -+ m_utf8_1 += "\""; -+ } -+ tagOpen (TT_A, m_utf8_1, ws_None); -+ } -+ } -+} -+ -+ -+void s_HTML_Listener::_handleMath (PT_AttrPropIndex api) -+{ -+ -+ m_utf8_1 = "a"; -+ if (tagTop () == TT_A) -+ { -+ tagClose (TT_A, m_utf8_1, ws_None); -+ } -+ m_utf8_1 = ""; -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = (api ? (m_pDocument->getAttrProp (api, &pAP)) : false); -+ -+ if (!bHaveProp || (pAP == 0)) return; -+ -+ const gchar * szDataID = 0; -+ bool bFound = pAP->getAttribute ("dataid", szDataID); -+ -+ if (szDataID == 0) return; // ?? -+ UT_UTF8String sMathML; -+ // -+ // OK shovel the mathml into the HTML stream -+ // -+ if (bFound && szDataID) -+ { -+ const UT_ByteBuf * pByteBuf = NULL; -+ bFound = m_pDocument->getDataItemDataByName(szDataID, -+ &pByteBuf, -+ NULL, NULL); -+ if(bFound) -+ { -+ UT_UCS4_mbtowc myWC; -+ sMathML.appendBuf( *pByteBuf, myWC); -+ tagRaw(sMathML); -+ } -+ } -+} -+ -+#ifdef HTML_META_SUPPORTED -+ -+void s_HTML_Listener::_handleMetaTag (const char * key, UT_UTF8String & value) -+{ -+ m_utf8_1 = "meta name=\""; -+ m_utf8_1 += key; -+ m_utf8_1 += "\" content=\""; -+ m_utf8_1 += value.escapeXML (); -+ m_utf8_1 += "\""; -+ -+ tagOpenClose (m_utf8_1, get_HTML4 ()); -+} -+ -+void s_HTML_Listener::_handleMeta () -+{ -+ if (!m_pie->isCopying ()) { -+ -+ UT_UTF8String metaProp; -+ -+ if (m_pDocument->getMetaDataProp (PD_META_KEY_TITLE, metaProp) && metaProp.size ()) -+ _handleMetaTag ("Title", metaProp); -+ -+ if (m_pDocument->getMetaDataProp (PD_META_KEY_CREATOR, metaProp) && metaProp.size ()) -+ _handleMetaTag ("Author", metaProp); -+ -+ if (m_pDocument->getMetaDataProp (PD_META_KEY_KEYWORDS, metaProp) && metaProp.size ()) -+ _handleMetaTag ("Keywords", metaProp); -+ -+ if (m_pDocument->getMetaDataProp (PD_META_KEY_SUBJECT, metaProp) && metaProp.size ()) -+ _handleMetaTag ("Subject", metaProp); -+ -+#if 0 -+ // now generically dump all of our data to meta stuff -+ const void * val = NULL ; -+ for ( val = cursor.first(); cursor.is_valid(); val = cursor.next () ) -+ { -+ if ( val ) -+ { -+ UT_String *stringval = static_cast(val); -+ if(stringval->size () > 0) -+ { -+ _handleMetaTag(cursor.key().c_str(), stringval->c_str())); -+ } -+ } -+#endif -+ -+ } -+} -+ -+#endif /* HTML_META_SUPPORTED */ -+ -+bool s_HTML_Listener::populate (PL_StruxFmtHandle /*sfh*/, const PX_ChangeRecord * pcr) -+{ -+ if (!m_bSecondPass || (m_bSecondPass && m_bInAFENote)) { -+ if (m_bFirstWrite && m_bClipBoard) -+ { -+ _openSection (0, 0); -+ _openTag (0, 0); -+ } -+ if(m_bIgnoreTillEnd || m_bIgnoreTillNextSection) -+ { -+ return true; -+ } -+ -+ switch (pcr->getType ()) -+ { -+ case PX_ChangeRecord::PXT_InsertSpan: -+ { -+ const PX_ChangeRecord_Span * pcrs = 0; -+ pcrs = static_cast(pcr); -+ -+ PT_AttrPropIndex api = pcr->getIndexAP (); -+ -+ _openSpan (api); -+ -+ PT_BufIndex bi = pcrs->getBufIndex (); -+ _outputData (m_pDocument->getPointer (bi), pcrs->getLength ()); -+ -+ // don't _closeSpan (); - leave open in case of identical sequences -+ -+ return true; -+ } -+ -+ case PX_ChangeRecord::PXT_InsertObject: -+ { -+ if (m_bInSpan) _closeSpan (); -+ -+ m_bWroteText = true; -+ -+ const PX_ChangeRecord_Object * pcro = 0; -+ pcro = static_cast(pcr); -+ -+ PT_AttrPropIndex api = pcr->getIndexAP (); -+ -+ switch (pcro->getObjectType ()) -+ { -+ case PTO_Image: -+ _handleImage (api); -+ return true; -+ -+ case PTO_Field: -+ _handleField (pcro, api); -+ return true; -+ -+ case PTO_Hyperlink: -+ _handleHyperlink (api); -+ return true; -+ -+ case PTO_Bookmark: -+ _handleBookmark (api); -+ return true; -+ -+ case PTO_Math: -+ _handleMath (api); -+ return true; -+ -+ case PTO_Embed: -+ _handleEmbedded (api); -+ return true; -+ -+ default: -+ UT_DEBUGMSG(("WARNING: ie_exp_HTML.cpp: unhandled object type: %d!\n", pcro->getObjectType ())); -+ UT_ASSERT_HARMLESS(UT_TODO); -+ return true; -+ } -+ } -+ -+ case PX_ChangeRecord::PXT_InsertFmtMark: -+ return true; -+ -+ default: -+ UT_DEBUGMSG(("WARNING: ie_exp_HTML.cpp: unhandled record type!\n")); -+ return true; -+ } -+ } -+ else return true; -+} -+ -+bool s_HTML_Listener::populateStrux (PL_StruxDocHandle sdh, -+ const PX_ChangeRecord * pcr, -+ PL_StruxFmtHandle * psfh) -+{ -+ UT_return_val_if_fail (pcr->getType() == PX_ChangeRecord::PXT_InsertStrux, false); -+ -+ *psfh = 0; // we don't need it. -+ -+ const PX_ChangeRecord_Strux * pcrx = static_cast(pcr); -+ -+ PT_AttrPropIndex api = pcr->getIndexAP (); -+ -+ switch (pcrx->getStruxType ()) -+ { -+ case PTX_Section: -+ { -+ m_bIgnoreTillNextSection = false; -+ -+ // TODO: It may be wise to look into the necessity of an _popUnendedStructures here. However, -+ // that may also not play nice with structures, if any, which span sections. Unended structures -+ // can theoretically do so, such as lists that attach to a extrastructural listID. However, we -+ // also (as of this writing) do not support incontiguous lists. Again, there's an ambiguity -+ // regarding how this should be handled because the behaviour of the piecetable is incompletely -+ // defined. -+ // UPDATE: We're going to put one in _closeSection for safety's sake. If it makes some output -+ // less pretty, please do file bugs and we can fix that on a case by case basis, but -+ // that's preferable to spitting out corrupt html. -+ -+ if(m_bIgnoreTillEnd) -+ { -+ return true; // Nested sections could be the sign of a severe problem, even if caused by import -+ } -+ -+ // This block prepares us for getting document-level properties (namely, the endnote-place-endsection one stored in doEndnotes) -+ PT_AttrPropIndex docApi = m_pDocument->getAttrPropIndex(); -+ const gchar * doEndnotes = NULL; -+ const PP_AttrProp * pDAP = NULL; -+ m_pDocument->getAttrProp (docApi, &pDAP); -+ -+ // If the d-e-p-e.s. prop is defined (getProp call succeeds and returns TRUE), and it is 1 (TRUE), we're supposed to spit out the endnotes every section. -+ if(pDAP->getProperty("document-endnote-place-endsection", doEndnotes) && atoi(doEndnotes)) -+ { _doEndnotes(); } // Spit out the endnotes that have accumulated for this past section. -+ -+ if (m_bInBlock) _closeTag (); // possible problem with lists?? -+ _openSection (api, 0); // Actually start the next section, which is why we're here. -+ return true; -+ } -+ -+ case PTX_Block: -+ { -+ if(m_bIgnoreTillEnd || m_bIgnoreTillNextSection) -+ { -+ return true; -+ } -+ if (m_bFirstWrite && m_bClipBoard) _openSection (0, 0); -+ _openTag (api, sdh); -+ return true; -+ } -+ -+#ifdef HTML_TABLES_SUPPORTED -+ case PTX_SectionTable: -+ { -+ if(m_bIgnoreTillEnd || m_bIgnoreTillNextSection) -+ { -+ return true; -+ } -+ if (m_bFirstWrite && m_bClipBoard) _openSection (0, 0); -+ -+ m_TableHelper.OpenTable(sdh,pcr->getIndexAP()) ; -+ _closeSpan(); -+ _closeTag(); -+ _openTable(pcr->getIndexAP()); -+ return true; -+ } -+ -+ case PTX_SectionCell: -+ { -+ if(m_bIgnoreTillEnd || m_bIgnoreTillNextSection) -+ { -+ return true; -+ } -+ if(m_TableHelper.getNestDepth() <1) -+ { -+ m_TableHelper.OpenTable(sdh,pcr->getIndexAP()) ; -+ _closeSpan(); -+ _closeTag(); -+ _openTable(pcr->getIndexAP()); -+ } -+ m_TableHelper.OpenCell(pcr->getIndexAP()) ; -+ _closeSpan(); -+ _closeTag(); -+ _openCell(pcr->getIndexAP()); -+ return true; -+ } -+ -+ case PTX_EndTable: -+ { -+ if(m_bIgnoreTillEnd || m_bIgnoreTillNextSection) -+ { -+ return true; -+ } -+ _closeTag(); -+ m_utf8_1 = "tr"; -+ tagClose (TT_TR, m_utf8_1); -+ m_TableHelper.CloseTable(); -+ _closeTable(); -+ return true; -+ } -+ -+ case PTX_EndCell: -+ { -+ if(m_bIgnoreTillEnd || m_bIgnoreTillNextSection) -+ { -+ return true; -+ } -+ _closeTag(); -+ _closeCell(); -+ if(m_TableHelper.getNestDepth() <1) -+ { -+ return true; -+ } -+ -+ m_TableHelper.CloseCell(); -+ return true; -+ } -+#endif /* HTML_TABLES_SUPPORTED */ -+ -+ case PTX_SectionFootnote: -+ case PTX_SectionEndnote: -+ { -+ // We should use strux-specific position markers, as this sets a precarious -+ // precedent for nested struxes. -+ m_iEmbedStartPos = pcrx->getPosition() + 1; -+ m_bIgnoreTillEnd = true; -+ return true; -+ } -+ case PTX_EndFootnote: -+ case PTX_EndEndnote: -+ { -+ PD_DocumentRange * pDocRange = new PD_DocumentRange(m_pDocument, m_iEmbedStartPos, pcrx->getPosition()); -+ if(pcrx->getStruxType () == PTX_EndFootnote) -+ { -+ addFootnote(pDocRange); -+ } -+ else -+ { -+ addEndnote(pDocRange); -+ } -+ m_bIgnoreTillEnd = false; -+ return true; -+ } -+ case PTX_SectionFrame: -+ { -+ // We do this individually for explicitly handled types of frame, because we don't know the consequences -+ // of doing it generally. -+ // m_bInFrame = true; // Fortunately for the html exporter, abi does not permit nested frames. -+ -+ if(m_iListDepth) -+ listPopToDepth(0); // AbiWord does not support frames in LIs, neither do we. -+ -+ if(m_bIgnoreTillEnd || m_bIgnoreTillNextSection) -+ { -+ return true; -+ } -+ // Set up to get and get the type of frame (a property thereof) -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ if (!bHaveProp || (pAP == 0)) return true; -+ const gchar * szType = 0; -+ if((pAP->getProperty ("frame-type", szType)) && szType) -+ { -+ if (!strcmp(szType, "textbox")) -+ { -+ _openTextBox(pcr->getIndexAP()); // Open a new text box -+ return true; -+ } -+ if(!strcmp(szType, "image")) -+ { -+ _openPosImage(pcr->getIndexAP()); // Output positioned image -+ } -+ } -+ return true; -+ } -+ case PTX_EndFrame: -+ { -+ _closeTextBox(); -+ return true; -+ } -+#if 0 -+ case PTX_EndMarginnote: -+ case PTX_SectionMarginnote: -+#endif -+ // Ignore HdrFtr for now -+ case PTX_SectionHdrFtr: -+ { -+ /* We need to close unended structures (like lists, which are known only as paragraphs with listIDs) -+ because the HdrFtr comes after all such things except for those which are contained within it. -MG */ -+ // This call may be unnecessary. -MG -+ _popUnendedStructures(); -+ m_bIgnoreTillNextSection = true; -+ return true; -+ } -+ case PTX_SectionTOC: -+ { -+ _emitTOC (pcr->getIndexAP()); -+ return true; -+ } -+ case PTX_EndTOC: -+ { -+ return true; -+ } -+ default: -+ UT_DEBUGMSG(("WARNING: ie_exp_HTML.cpp: unhandled strux type: %d!\n", pcrx->getStruxType ())); -+ UT_ASSERT_HARMLESS(UT_TODO); -+ return true; -+ } -+ -+ -+} -+ -+bool s_HTML_Listener::endOfDocument () { -+ m_bIgnoreTillNextSection = false; -+ _popUnendedStructures(); // We need to clean up after ourselves lest we fsck up the footer and anything else that comes after this. -+ /* Remaining endnotes, whether from the last of multiple sections or from all sections */ -+ _doEndnotes(); -+ -+ _doFootnotes(); -+ -+ return true; -+} -+ -+void s_HTML_Listener::_emitTOC (PT_AttrPropIndex api) { -+ if (m_toc) { -+ -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = (api ? (m_pDocument->getAttrProp (api, &pAP)) : false); -+ const gchar * szValue = 0; -+ UT_UTF8String tocHeadingUTF8; -+ -+ listPopToDepth(0); -+ -+ if (tagTop() == TT_SPAN) { -+ UT_DEBUGMSG(("_closeSection closing span\n")); -+ tagClose(TT_SPAN, "span"); -+ } -+ -+ if (m_bInBlock && (tagTop() == TT_P)) { // If only the first is true, we have a first-order tag mismatch. The alternative with not testing the latter is a second-order tag mismatch. -+ UT_DEBUGMSG(("_closeSection closing block\n")); -+ // _closeTag (); // We need to investigate the tag stack usage of this, and whether or not we really would rather specify the tag in all cases. -+ tagClose(TT_P, "p"); -+ } -+ -+ if(bHaveProp && pAP && pAP->getProperty("toc-heading", szValue)) // user-defined TOC heading -+ { -+ tocHeadingUTF8 = szValue; -+ //_outputdata() below makes escapeXML() redundant here -+ } -+ else -+ { -+ const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); -+ pSS->getValueUTF8(AP_STRING_ID_TOC_TocHeading, tocHeadingUTF8); -+ } -+ -+ bool bEmitHeading = true; -+ -+ if(bHaveProp && pAP && pAP->getProperty("toc-has-heading", szValue)) //check to see if the TOC heading is hidden -+ { -+ if(atoi(szValue) == 0) -+ bEmitHeading = false; -+ } -+ -+ // We can't use escapeXML() on tocHeadingUTF8 here because it will -+ // cause values to be doubly escaped, e.g. " will become &quot;. -+ // Instead, just use a new variable, tocSummary. -+ -+ UT_UTF8String tocSummary = tocHeadingUTF8; -+ m_utf8_1 = UT_UTF8String_sprintf("table class=\"toc\" summary=\"%s\"", tocSummary.escapeXML().utf8_str()); -+ -+ tagOpen (TT_TABLE, m_utf8_1); -+ -+ m_utf8_1 = "tr"; -+ tagOpen (TT_TR, m_utf8_1); -+ -+ m_utf8_1 = "td"; -+ tagOpen (TT_TD, m_utf8_1); -+ -+ m_utf8_1 = "div class=\"toctitle\""; -+ tagOpen (TT_DIV, m_utf8_1); -+ -+ if(bEmitHeading) -+ { -+ UT_UCS4String tocHeading(tocHeadingUTF8.utf8_str()); -+ m_utf8_1 = "h2"; -+ tagOpen (TT_H2, m_utf8_1); -+ m_bInBlock = true; -+ _outputData (tocHeading.ucs4_str(), tocHeading.length()); -+ m_bInBlock = false; -+ tagClose (TT_H2, "h2"); -+ } -+ -+ tagClose (TT_DIV, "div"); -+ -+ int level1_depth = 0; -+ int level2_depth = 0; -+ int level3_depth = 0; -+ int level4_depth = 0; -+ -+ m_bInTOC = true; -+ for (int i = 0; i < m_toc->getNumTOCEntries(); i++) { -+ int tocLevel = 0; -+ -+ UT_UCS4String tocText(m_toc->getNthTOCEntry(i, &tocLevel).utf8_str()); -+ -+ { -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ m_utf8_1 = UT_UTF8String_sprintf("p style=\"text-indent:%gin\"", ((tocLevel-1) * .5)); -+ } -+ -+ UT_UCS4String tocLevelText; -+ if(tocLevel == 1) { -+ level1_depth++; -+ level2_depth = level3_depth = level4_depth = 0; -+ -+ tocLevelText = UT_UTF8String_sprintf("[%d] ", level1_depth).ucs4_str(); -+ } else if(tocLevel == 2) { -+ level2_depth++; -+ level3_depth = level4_depth = 0; -+ tocLevelText = UT_UTF8String_sprintf("[%d.%d] ", level1_depth, level2_depth).ucs4_str(); -+ } else if(tocLevel == 3) { -+ level3_depth++; -+ level4_depth = 0; -+ tocLevelText = UT_UTF8String_sprintf("[%d.%d.%d] ", level1_depth, level2_depth, level3_depth).ucs4_str(); -+ } else if(tocLevel == 4) { -+ level4_depth++; -+ tocLevelText = UT_UTF8String_sprintf("[%d.%d.%d.%d] ", level1_depth, level2_depth, level3_depth, level4_depth).ucs4_str(); -+ } -+ -+ UT_UTF8String tocLink(UT_UTF8String_sprintf("", i)); -+ tagOpen (TT_P, m_utf8_1); -+ m_bInBlock = true; -+ m_pie->write(tocLink.utf8_str(), tocLink.byteLength()); -+ _outputData (tocLevelText.ucs4_str(), tocLevelText.length()); -+ _outputData (tocText.ucs4_str(), tocText.length()); -+ m_pie->write("", 4); -+ m_bInBlock = false; -+ tagClose (TT_P, "p"); -+ } -+ -+ tagClose (TT_TD, "td"); -+ tagClose (TT_TT, "tr"); -+ tagClose (TT_TABLE, "table"); -+ -+ m_bInTOC = false; -+ } -+} -+ -+void s_HTML_Listener::_doEndnotes () { -+ // -+ // Output Endnotes -+ // -+ UT_uint32 i = 0; -+ for(i=0; i< getNumEndnotes(); i++) -+ { -+ PD_DocumentRange * pDocRange = m_vecEndnotes.getNthItem(i); -+ m_bInAFENote = true; -+ m_pDocument->tellListenerSubset(this,pDocRange); -+ m_bInAFENote = false; -+ // Some combined bug fixes make tagpops no longer necessary, afaict. -MG -+ } -+ UT_VECTOR_PURGEALL(PD_DocumentRange *,m_vecEndnotes); -+} -+ -+void s_HTML_Listener::_doFootnotes () { -+ // -+ // Output footnotes -+ // -+ UT_uint32 i = 0, nFootnotes = getNumFootnotes(); -+ if(nFootnotes > 0) { -+ startEmbeddedStrux(); -+ } -+ for(i = 0; i < nFootnotes; i = i + 1) -+ { -+ PD_DocumentRange * pDocRange = m_vecFootnotes.getNthItem(i); -+ m_bInAFENote = true; -+ m_pDocument->tellListenerSubset(this,pDocRange); -+ m_bInAFENote = false; -+ // Some combined bug fixes make tagpops no longer necessary, afaict. -+ } -+ UT_VECTOR_PURGEALL(PD_DocumentRange *,m_vecFootnotes); -+} -+ -+/*****************************************************************/ -+/*****************************************************************/ -+ -+bool s_HTML_Listener::change (PL_StruxFmtHandle /*sfh*/, -+ const PX_ChangeRecord * /*pcr*/) -+{ -+ UT_ASSERT_HARMLESS(0); // this function is not used. -+ return false; -+} -+ -+bool s_HTML_Listener::insertStrux (PL_StruxFmtHandle /*sfh*/, -+ const PX_ChangeRecord * /*pcr*/, -+ PL_StruxDocHandle /*sdh*/, -+ PL_ListenerId /* lid */, -+ void (* /*pfnBindHandles*/)(PL_StruxDocHandle /* sdhNew */, -+ PL_ListenerId /* lid */, -+ PL_StruxFmtHandle /* sfhNew */)) -+{ -+ UT_ASSERT_HARMLESS(0); // this function is not used. -+ return false; -+} -+ -+bool s_HTML_Listener::signal (UT_uint32 /* iSignal */) -+{ -+ UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); -+ return false; -+} -+ -+/*****************************************************************/ -+/*****************************************************************/ -+ -+s_HTML_HdrFtr_Listener::s_HTML_HdrFtr_Listener (PD_Document * pDocument, IE_Exp_HTML * pie, PL_Listener * pHTML_Listener) : -+ m_pHdrDocRange(NULL), -+ m_pFtrDocRange(NULL), -+ m_pDocument(pDocument), -+ m_pHTML_Listener(pHTML_Listener) -+{ -+} -+ -+s_HTML_HdrFtr_Listener::~s_HTML_HdrFtr_Listener () -+{ -+} -+ -+void s_HTML_HdrFtr_Listener::doHdrFtr (bool bHeader) -+{ -+ s_HTML_Listener * pHL = (s_HTML_Listener *)m_pHTML_Listener; -+ if(bHeader && pHL->m_bHaveHeader) { -+ pHL->_openSection(0, 1); -+ m_pDocument->tellListenerSubset(m_pHTML_Listener, m_pHdrDocRange); -+ pHL->_closeSection(); } -+ if(!bHeader && pHL->m_bHaveFooter) { -+ pHL->_openSection(0, 2); -+ m_pDocument->tellListenerSubset(m_pHTML_Listener, m_pFtrDocRange); -+ pHL->_closeSection(); } -+ if(bHeader && pHL->m_bHaveHeader) { -+ pHL->_openSection(0, 3); } -+ if(bHeader) -+ DELETEP(m_pHdrDocRange); -+ else -+ DELETEP(m_pFtrDocRange); -+} -+ -+bool s_HTML_HdrFtr_Listener::populateStrux (PL_StruxDocHandle sdh, -+ const PX_ChangeRecord * pcr, -+ PL_StruxFmtHandle * psfh) -+{ -+ /* Housekeeping and prep */ -+ UT_return_val_if_fail (pcr->getType() == PX_ChangeRecord::PXT_InsertStrux, false); -+ *psfh = 0; // we don't need it. -+ const PX_ChangeRecord_Strux * pcrx = static_cast(pcr); -+ PT_AttrPropIndex api = pcr->getIndexAP (); -+ switch (pcrx->getStruxType ()) -+ { -+ case PTX_SectionHdrFtr: -+ { -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = m_pDocument->getAttrProp (api, &pAP); -+ -+ if (!bHaveProp || (pAP == 0)) return true; -+ -+ const gchar * szType = 0; -+ pAP->getAttribute ("type", szType); -+ /* // */ -+ -+ PT_DocPosition m_iHdrFtrStartPos = m_pDocument->getStruxPosition(sdh) + 1; -+ PT_DocPosition m_iHdrFtrStopPos = 0; -+ PL_StruxDocHandle * nextSDH = NULL; -+ bool bHaveNextSection = m_pDocument->getNextStruxOfType(sdh, PTX_Section, nextSDH); -+ if (bHaveNextSection) -+ { -+ m_iHdrFtrStopPos = m_pDocument->getStruxPosition(nextSDH); -+ } else -+ { -+ m_pDocument->getBounds(true, m_iHdrFtrStopPos); -+ } -+ PD_DocumentRange * pDocRange = new PD_DocumentRange(m_pDocument, m_iHdrFtrStartPos, m_iHdrFtrStopPos); -+ if(!strcmp(szType, "header")) -+ { -+ m_pHdrDocRange = pDocRange; -+ s_HTML_Listener * pHL = (s_HTML_Listener *)m_pHTML_Listener; -+ pHL->setHaveHeader(); -+ } -+ else -+ { -+ m_pFtrDocRange = pDocRange; -+ s_HTML_Listener * pHL = (s_HTML_Listener *)m_pHTML_Listener; -+ pHL->setHaveFooter(); -+ } -+ return true; -+ } -+ default: -+ return true; -+ } -+} -+ -+bool s_HTML_HdrFtr_Listener::populate (PL_StruxFmtHandle /*sfh*/, const PX_ChangeRecord * pcr) -+{ -+ return true; -+} -+ -+bool s_HTML_HdrFtr_Listener::change (PL_StruxFmtHandle /*sfh*/, -+ const PX_ChangeRecord * /*pcr*/) -+{ -+ UT_ASSERT_HARMLESS(0); // this function is not used. -+ return false; -+} -+ -+bool s_HTML_HdrFtr_Listener::insertStrux (PL_StruxFmtHandle /*sfh*/, -+ const PX_ChangeRecord * /*pcr*/, -+ PL_StruxDocHandle /*sdh*/, -+ PL_ListenerId /* lid */, -+ void (* /*pfnBindHandles*/)(PL_StruxDocHandle /* sdhNew */, -+ PL_ListenerId /* lid */, -+ PL_StruxFmtHandle /* sfhNew */)) -+{ -+ UT_ASSERT_HARMLESS(0); // this function is not used. -+ return false; -+} -+ -+bool s_HTML_HdrFtr_Listener::signal (UT_uint32 /* iSignal */) -+{ -+ UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); -+ return false; -+} -+ -+/*****************************************************************/ -+/*****************************************************************/ -+ -+s_StyleTree::s_StyleTree (s_StyleTree * parent, const char * style_name, PD_Style * style) : -+ m_pDocument(0), -+ m_parent(parent), -+ m_list(0), -+ m_count(0), -+ m_max(0), -+ m_bInUse(false), -+ m_style_name(style_name), -+ m_class_name(style_name), -+ m_class_list(style_name), -+ m_style(style) -+{ -+ UT_LocaleTransactor t(LC_NUMERIC, "C"); -+ -+ if ((m_style_name == "Heading 1") || -+ (m_style_name == "Heading 2") || -+ (m_style_name == "Heading 3") || -+ (m_style_name == "Normal")) -+ { -+ m_class_name = ""; -+ m_class_list = ""; -+ } -+ else -+ { -+ s_removeWhiteSpace (style_name, m_class_name, true); -+ m_class_list = m_class_name; -+ } -+ -+ if (parent->class_list () != "") -+ { -+ m_class_list += " "; -+ m_class_list += parent->class_list (); -+ } -+ -+ UT_uint32 j = 0; -+ -+ const gchar * szName = 0; -+ const gchar * szValue = 0; -+ -+ UT_UTF8String name; -+ UT_UTF8String value; -+ -+ while (style->getNthProperty (j++, szName, szValue)) -+ { -+ name = szName; -+ value = szValue; -+ -+ /* map property names to CSS equivalents -+ */ -+ if (name == "text-position") -+ { -+ name = "vertical-align"; -+ if(value == "superscript") -+ value = "super"; -+ else if(value == "subscript") -+ value = "sub"; -+ -+ } -+ else if (name == "bgcolor") -+ { -+ name = "background-color"; -+ } -+ else if (!is_CSS (szName)) continue; -+ -+ /* map property values to CSS equivalents -+ */ -+ if (name == "font-family") -+ { -+ if (!((value == "serif") || (value == "sans-serif") || -+ (value == "cursive") || (value == "fantasy") || (value == "monospace"))) -+ { -+ value = "'"; -+ value += szValue; -+ value += "'"; -+ } -+ } -+ else if ((name == "color") || (name == "background-color")) -+ { -+ if (value != "transparent") -+ { -+ if(value.substr(0, 1) != "#") -+ { -+ value = "#"; -+ } -+ else -+ { -+ xxx_UT_DEBUGMSG(("HTML exporter: encountered RGB color with '#' prefixed\n")); -+ value.clear(); -+ } -+ -+ value += szValue; -+ } -+ } -+ else if (strstr(name.utf8_str(), "width")) -+ { -+ if(strstr(name.utf8_str(), "border")) -+ { -+ double dPT = UT_convertToDimension(value.utf8_str(), DIM_PT); -+ value = UT_UTF8String_sprintf("%.2fpt", dPT); -+ } -+ else -+ { -+ double dMM = UT_convertToDimension(value.utf8_str(), DIM_MM); -+ value = UT_UTF8String_sprintf("%.1fmm", dMM); -+ } -+ } -+ -+ const std::string & cascade_value = lookup (name.utf8_str()); -+ if (!cascade_value.empty()) -+ if (cascade_value == value) -+ continue; -+ -+ m_map.insert(map_type::value_type(name.utf8_str(), -+ value.utf8_str())); -+ } -+ if ((m_style_name == "Heading 1") || -+ (m_style_name == "Heading 2") || -+ (m_style_name == "Heading 3") || -+ (m_style_name == "Section Heading") || -+ (m_style_name == "Chapter Heading")) -+ { -+ m_map.insert(map_type::value_type("page-break-after", "avoid")); -+ } -+} -+ -+s_StyleTree::s_StyleTree (PD_Document * pDocument) : -+ m_pDocument(pDocument), -+ m_parent(0), -+ m_list(0), -+ m_count(0), -+ m_max(0), -+ m_bInUse(false), -+ m_style_name("None"), -+ m_class_name(""), -+ m_class_list(""), -+ m_style(0) -+{ -+ const char ** ptr = s_prop_list; -+ while(*ptr) -+ { -+ m_map.insert(map_type::value_type(*ptr, *(ptr+1))); -+ ptr += 2; -+ } -+} -+ -+s_StyleTree::~s_StyleTree () -+{ -+ for (UT_uint32 i = 0; i < m_count; i++) -+ { -+ DELETEP(m_list[i]); -+ } -+ FREEP (m_list); -+} -+ -+bool s_StyleTree::add (const char * style_name, PD_Style * style) -+{ -+ if (m_list == 0) -+ { -+ m_list = reinterpret_cast(g_try_malloc (8 * sizeof (s_StyleTree *))); -+ if (m_list == 0) return false; -+ m_max = 8; -+ } -+ if (m_count == m_max) -+ { -+ s_StyleTree ** more = 0; -+ more = reinterpret_cast(g_try_realloc (m_list, (m_max + 8) * sizeof (s_StyleTree *))); -+ if (more == 0) return false; -+ m_list = more; -+ m_max += 8; -+ } -+ -+ s_StyleTree * tree = 0; -+ -+ UT_TRY -+ { -+ tree = new s_StyleTree(this,style_name,style); -+ } -+ UT_CATCH(UT_CATCH_ANY) -+ { -+ tree = 0; -+ } -+ UT_END_CATCH -+ -+ if (tree == 0) return false; -+ -+ m_list[m_count++] = tree; -+ -+ return true; -+} -+ -+bool s_StyleTree::add (const char * style_name, PD_Document * pDoc) -+{ -+ if ((pDoc == 0) || (style_name == 0) || (*style_name == 0)) return false; -+ -+ if (m_parent) return m_parent->add (style_name, pDoc); -+ -+ if (find (style_name)) return true; -+ -+ PD_Style * style = 0; -+ pDoc->getStyle (style_name, &style); -+ if (!style) return false; -+ -+ s_StyleTree * parent = NULL; -+ -+ PD_Style * basis = style->getBasedOn (); -+ -+ const gchar * parent_name = NULL; -+ if (basis && -+ basis->getAttribute (PT_NAME_ATTRIBUTE_NAME, parent_name) && -+ strcmp(style_name, parent_name) != 0) -+ { -+ parent = const_cast(find (basis)); -+ if (parent == NULL) -+ { -+ const gchar * basis_name = 0; -+ basis->getAttribute (PT_NAME_ATTRIBUTE_NAME, basis_name); -+ if (!basis_name) return false; -+ -+ if (basis->getBasedOn() && basis->getBasedOn()->getName() && -+ !strcmp(style_name, basis->getBasedOn()->getName())) -+ { -+ parent = this; -+ } -+ else -+ { -+ if (!add (basis_name, pDoc)) return false; -+ -+ parent = const_cast(find (basis)); -+ } -+ } -+ } -+ else -+ parent = this; -+ -+ if (!parent) { -+ UT_ASSERT_NOT_REACHED(); -+ return false; -+ } -+ return parent->add (style_name, style); -+} -+ -+void s_StyleTree::inUse () -+{ -+ m_bInUse = true; -+ if (m_parent) -+ m_parent->inUse (); -+} -+ -+const s_StyleTree * s_StyleTree::findAndUse (const char * style_name) -+{ -+ const s_StyleTree * style_tree = find (style_name); -+ -+ if (style_tree) -+ { -+ s_StyleTree * tree = const_cast(style_tree); -+ tree->inUse (); -+ } -+ return style_tree; -+} -+ -+const s_StyleTree * s_StyleTree::find (const char * style_name) const -+{ -+ if (m_style_name == style_name) return this; -+ -+ const s_StyleTree * tree = 0; -+ -+ for (UT_uint32 i = 0; i < m_count; i++) -+ { -+ tree = m_list[i]->find (style_name); -+ if (tree) break; -+ } -+ return tree; -+} -+ -+const s_StyleTree * s_StyleTree::find (PD_Style * style) const -+{ -+ const gchar * style_name = 0; -+ style->getAttribute (PT_NAME_ATTRIBUTE_NAME, style_name); -+ if (!style_name) return NULL; -+ -+ return find (style_name); -+} -+ -+bool s_StyleTree::descends (const char * style_name) const -+{ -+ if (m_parent == 0) return false; -+ -+ // the name comparison has to be be case insensitive -+ if (!g_ascii_strcasecmp(m_style_name.utf8_str(),style_name)) return true; -+ -+ return m_parent->descends (style_name); -+} -+ -+void s_StyleTree::print (s_HTML_Listener * listener) const -+{ -+ if (!m_bInUse) return; -+ -+ if (strstr (m_style_name.utf8_str (), "List")) return; -+ -+ if (m_parent) -+ { -+ UT_UTF8String selector("*."); -+ if (m_class_name.byteLength ()) -+ { -+ selector += m_class_name; -+ } -+ else -+ { -+ if (m_style_name == "Normal") -+ selector = "p, h1, h2, h3, li"; -+ else if (m_style_name == "Heading 1") -+ selector = "h1"; -+ else if (m_style_name == "Heading 2") -+ selector = "h2"; -+ else if (m_style_name == "Heading 3") -+ selector = "h3"; -+ } -+ listener->styleOpen (selector); -+ -+ for (map_type::const_iterator iter = m_map.begin(); -+ iter != m_map.end(); iter++) { -+ listener->styleNameValue((*iter).first.c_str(), -+ (*iter).second.c_str()); -+ } -+ listener->styleClose (); -+ } -+ for (UT_uint32 i = 0; i < m_count; i++) -+ { -+ m_list[i]->print (listener); -+ } -+} -+ -+const std::string & s_StyleTree::lookup (const std::string & prop_name) const -+{ -+ static std::string empty; -+ map_type::const_iterator prop_iter = m_map.find(prop_name); -+ -+ if (prop_iter == m_map.end()) { -+ if(m_parent) { -+ return m_parent->lookup (prop_name); -+ } -+ else { -+ return empty; -+ } -+ } -+ return (*prop_iter).second; -+} -+ -+void s_StyleTree::styleCheck (PT_AttrPropIndex api) -+{ -+ const PP_AttrProp * pAP = 0; -+ bool bHaveProp = (api ? (m_pDocument->getAttrProp (api, &pAP)) : false); -+ -+ if (bHaveProp && pAP) -+ { -+ const gchar * szStyle = NULL; -+ bool have_style = pAP->getAttribute (PT_STYLE_ATTRIBUTE_NAME, szStyle); -+ -+ if (have_style && szStyle) -+ { -+ findAndUse (szStyle); -+ } -+ } -+} -+ -+bool s_StyleTree::populate (PL_StruxFmtHandle /*sfh*/, const PX_ChangeRecord * pcr) -+{ -+ switch (pcr->getType ()) -+ { -+ case PX_ChangeRecord::PXT_InsertSpan: -+ styleCheck (pcr->getIndexAP ()); -+ break; -+ case PX_ChangeRecord::PXT_InsertObject: -+ styleCheck (pcr->getIndexAP ()); -+ break; -+ default: -+ break; -+ } -+ return true; -+} -+ -+bool s_StyleTree::populateStrux (PL_StruxDocHandle /*sdh*/, -+ const PX_ChangeRecord * pcr, -+ PL_StruxFmtHandle * psfh) -+{ -+ UT_return_val_if_fail (pcr->getType() == PX_ChangeRecord::PXT_InsertStrux, false); -+ -+ *psfh = 0; // we don't need it. -+ -+ const PX_ChangeRecord_Strux * pcrx = static_cast(pcr); -+ -+ switch (pcrx->getStruxType ()) -+ { -+ case PTX_Block: -+ styleCheck (pcr->getIndexAP ()); -+ break; -+ case PTX_SectionFootnote: -+ styleCheck (pcr->getIndexAP ()); -+ break; -+ case PTX_SectionEndnote: -+ styleCheck (pcr->getIndexAP ()); -+ break; -+ default: -+ break; -+ } -+ return true; -+} -+ -+bool s_StyleTree::change (PL_StruxFmtHandle /*sfh*/, -+ const PX_ChangeRecord * /*pcr*/) -+{ -+ UT_ASSERT_HARMLESS(0); // this function is not used. -+ return false; -+} -+ -+bool s_StyleTree::insertStrux (PL_StruxFmtHandle /*sfh*/, -+ const PX_ChangeRecord * /*pcr*/, -+ PL_StruxDocHandle /*sdh*/, -+ PL_ListenerId /* lid */, -+ void (* /*pfnBindHandles*/)(PL_StruxDocHandle /* sdhNew */, -+ PL_ListenerId /* lid */, -+ PL_StruxFmtHandle /* sfhNew */)) -+{ -+ UT_ASSERT_HARMLESS(0); // this function is not used. -+ return false; -+} -+ -+bool s_StyleTree::signal (UT_uint32 /* iSignal */) -+{ -+ UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN); -+ return false; -+} -+ -+/*****************************************************************/ -+/*****************************************************************/ -+ -+#ifdef TH_SKIP_REST -+#undef TH_SKIP_REST -+#endif -+#define TH_SKIP_REST 1 -+ -+#ifdef TH_SKIP_THIS -+#undef TH_SKIP_THIS -+#endif -+#define TH_SKIP_THIS 2 -+ -+class ABI_EXPORT s_TemplateHandler : public UT_XML::ExpertListener -+{ -+public: -+ s_TemplateHandler (PD_Document * pDocument, IE_Exp_HTML * pie); -+ -+ ~s_TemplateHandler (); -+ -+ /* Implementation of ExpertListener -+ */ -+ void StartElement (const gchar * name, const gchar ** atts); -+ void EndElement (const gchar * name); -+ void CharData (const gchar * buffer, int length); -+ void ProcessingInstruction (const gchar * target, const gchar * data); -+ void Comment (const gchar * data); -+ void StartCdataSection (); -+ void EndCdataSection (); -+ void Default (const gchar * buffer, int length); -+ -+private: -+ void _handleMetaTag (const char * key, UT_UTF8String & value); -+ void _handleMeta (); -+ -+ bool echo () const; -+ bool condition (const gchar * data) const; -+ -+ PD_Document * m_pDocument; -+ IE_Exp_HTML * m_pie; -+ -+ bool m_cdata; -+ bool m_empty; -+ -+ UT_UTF8String m_utf8; -+ UT_UTF8String m_root; -+ typedef std::map hash_type; -+ hash_type m_hash; -+ UT_NumberStack m_mode; -+}; -+ -+s_TemplateHandler::s_TemplateHandler (PD_Document * pDocument, IE_Exp_HTML * pie) : -+ m_pDocument(pDocument), -+ m_pie(pie), -+ m_cdata(false), -+ m_empty(false) -+{ -+ const std::string & prop = m_pie->getProperty ("href-prefix"); -+ if (!prop.empty()) -+ m_root = prop; -+} -+ -+s_TemplateHandler::~s_TemplateHandler () -+{ -+ // -+} -+ -+void s_TemplateHandler::StartElement (const gchar * name, const gchar ** atts) -+{ -+ if (!echo ()) return; -+ -+ if (m_empty) -+ { -+ m_pie->write (">", 1); -+ m_empty = false; -+ } -+ -+ m_utf8 = "<"; -+ m_utf8 += name; -+ -+ if (atts) -+ { -+ const gchar ** attr = atts; -+ -+ UT_UTF8String tmp; -+ -+ while (*attr) -+ { -+ bool href = ( (strcmp (*attr, "href") == 0) || -+ ((strcmp (*attr, "src" ) == 0) && (strcmp (name, "img") == 0)) ); -+ -+ m_utf8 += " "; -+ m_utf8 += *attr++; -+ m_utf8 += "=\""; -+ -+ if (href && (**attr == '$')) -+ { -+ tmp = m_root; -+ tmp += (*attr++ + 1); -+ } -+ else -+ { -+ tmp = *attr++; -+ } -+ tmp.escapeXML (); -+ -+ m_utf8 += tmp; -+ m_utf8 += "\""; -+ } -+ } -+ m_pie->write (m_utf8.utf8_str (), m_utf8.byteLength ()); -+ -+ m_empty = true; -+} -+ -+void s_TemplateHandler::EndElement (const gchar * name) -+{ -+ if (!echo ()) return; -+ -+ if (m_empty) -+ { -+ m_pie->write (" />", 3); -+ m_empty = false; -+ } -+ else -+ { -+ m_utf8 = ""; -+ m_pie->write (m_utf8.utf8_str (), m_utf8.byteLength ()); -+ } -+} -+ -+void s_TemplateHandler::CharData (const gchar * buffer, int length) -+{ -+ if (!echo ()) return; -+ -+ if (m_empty) -+ { -+ m_pie->write (">", 1); -+ m_empty = false; -+ } -+ if (m_cdata) -+ { -+ m_pie->write (buffer, length); -+ return; -+ } -+ m_utf8 = buffer; -+ m_utf8.escapeXML (); -+ m_pie->write (m_utf8.utf8_str (), m_utf8.byteLength ()); -+} -+ -+void s_TemplateHandler::ProcessingInstruction (const gchar * target, const gchar * data) -+{ -+ bool bAbiXHTML = (strncmp (target, "abi-xhtml-", 10) == 0); -+ -+ if (!bAbiXHTML && !echo ()) return; -+ -+ if (m_empty) -+ { -+ m_pie->write (">", 1); -+ m_empty = false; -+ } -+ if (!bAbiXHTML) -+ { -+ /* processing instruction not relevant to this - could be PHP, etc. -+ */ -+ m_utf8 = ""; -+ m_pie->write (m_utf8.utf8_str (), m_utf8.byteLength ()); -+ return; -+ } -+ m_utf8 = target + 10; -+ -+ if ((m_utf8 == "insert") && echo ()) -+ { -+ m_utf8 = data; -+ -+ if (m_utf8 == "title") -+ { -+#ifdef HTML_META_SUPPORTED -+ m_utf8 = ""; -+ -+ m_pDocument->getMetaDataProp (PD_META_KEY_TITLE, m_utf8); -+ -+ if (m_utf8.byteLength () == 0) -+ m_utf8 = m_pie->getFileName (); -+ -+ m_utf8.escapeXML (); -+ m_pie->write (m_utf8.utf8_str (), m_utf8.byteLength ()); -+#endif /* HTML_META_SUPPORTED */ -+ } -+ else if (m_utf8 == "creator") -+ { -+#ifdef HTML_META_SUPPORTED -+ m_utf8 = ""; -+ -+ m_pDocument->getMetaDataProp (PD_META_KEY_CREATOR, m_utf8); -+ -+ if (m_utf8.byteLength ()) -+ { -+ m_utf8.escapeXML (); -+ m_pie->write (m_utf8.utf8_str (), m_utf8.byteLength ()); -+ } -+#endif /* HTML_META_SUPPORTED */ -+ } -+ else if (m_utf8 == "meta") -+ { -+#ifdef HTML_META_SUPPORTED -+ _handleMeta (); -+#endif /* HTML_META_SUPPORTED */ -+ } -+ else if (m_utf8 == "body") -+ { -+ m_pie->_writeDocument (false, true); -+ } -+ } -+ else if ((m_utf8 == "comment-replace") && echo ()) -+ { -+ m_hash.clear (); -+ UT_parse_attributes(data, m_hash); -+ -+ const std::string & sz_property(m_hash["property"]); -+ const std::string & sz_comment(m_hash["comment"]); -+ -+ if (sz_property.size() && sz_comment.size()) -+ { -+#ifdef HTML_META_SUPPORTED -+ UT_UTF8String creator = ""; -+#endif /* HTML_META_SUPPORTED */ -+ std::string prop; -+ -+ if (sz_property == "meta::creator") -+ { -+#ifdef HTML_META_SUPPORTED -+ m_pDocument->getMetaDataProp (PD_META_KEY_CREATOR, creator); -+ -+ if (creator.byteLength ()) -+ prop = creator.utf8_str(); -+#endif /* HTML_META_SUPPORTED */ -+ } -+ else -+ { -+ prop = m_pie->getProperty (sz_property.c_str()); -+ } -+ if (!prop.empty()) -+ { -+ const UT_UTF8String DD("$$"); -+ -+ m_utf8 = sz_comment.c_str(); -+ m_utf8.escape (DD, prop.c_str()); -+ -+ m_pie->write ("", 3); -+ } -+ } -+ } -+ else if ((m_utf8 == "menuitem") && echo ()) -+ { -+ m_hash.clear(); -+ UT_parse_attributes(data, m_hash); -+ -+ const std::string sz_property = m_hash["property"]; -+ const std::string sz_class = m_hash["class"]; -+ std::string sz_href = m_hash["href"]; -+ const std::string sz_label = m_hash["label"]; -+ -+ if (sz_property.size() && sz_class.size() -+ && sz_href.size() && sz_label.size()) -+ { -+ const char * href = sz_href.c_str(); -+ -+ if (*href == '$') -+ { -+ m_utf8 = m_root; -+ m_utf8 += href + 1; -+ -+ m_hash["href"] = m_utf8.utf8_str(); -+ -+ sz_href = m_utf8.utf8_str(); -+ } -+ -+ const std::string & prop = m_pie->getProperty(sz_property.c_str()); -+ -+ bool ne = (prop != sz_class); -+ -+ m_utf8 = "
"; -+ m_utf8 += sz_label; -+ m_utf8 += "
"; -+ if (ne) -+ { -+ m_utf8 += "
"; -+ } -+ m_utf8 += ""; -+ -+ m_pie->write (m_utf8.utf8_str (), m_utf8.byteLength ()); -+ } -+ } -+ else if (m_utf8 == "if") -+ { -+ if (echo ()) -+ { -+ if (condition (data)) -+ m_mode.push (0); -+ else -+ m_mode.push (TH_SKIP_THIS); -+ } -+ else -+ { -+ m_mode.push (TH_SKIP_REST); -+ } -+ } -+ else if (m_mode.getDepth ()) -+ { -+ UT_sint32 mode; -+ m_mode.viewTop (mode); -+ -+ if (m_utf8 == "elif") -+ { -+ if (mode == TH_SKIP_THIS) -+ { -+ if (condition (data)) -+ { -+ m_mode.pop (); -+ m_mode.push (0); -+ } -+ } -+ else if (mode != TH_SKIP_REST) -+ { -+ m_mode.pop (); -+ m_mode.push (TH_SKIP_REST); -+ } -+ } -+ else if (m_utf8 == "else") -+ { -+ if (mode == TH_SKIP_THIS) -+ { -+ if (condition (data)) -+ { -+ m_mode.pop (); -+ m_mode.push (0); -+ } -+ } -+ else if (mode != TH_SKIP_REST) -+ { -+ m_mode.pop (); -+ m_mode.push (TH_SKIP_REST); -+ } -+ } -+ else if (m_utf8 == "fi") -+ { -+ m_mode.pop (); -+ } -+ } -+} -+ -+#ifdef HTML_META_SUPPORTED -+ -+void s_TemplateHandler::_handleMetaTag (const char * key, UT_UTF8String & value) -+{ -+ m_utf8 = ""; -+ m_utf8 += MYEOL; -+ m_pie->write (m_utf8.utf8_str (), m_utf8.byteLength ()); -+} -+ -+void s_TemplateHandler::_handleMeta () -+{ -+ UT_UTF8String metaProp = "" MYEOL; -+ -+ m_pie->write (metaProp.utf8_str (), metaProp.byteLength ()); -+ -+ if (!m_pie->isCopying ()) { -+ -+ if (m_pDocument->getMetaDataProp (PD_META_KEY_CREATOR, metaProp) && metaProp.size ()) -+ _handleMetaTag ("Author", metaProp); -+ -+ if (m_pDocument->getMetaDataProp (PD_META_KEY_KEYWORDS, metaProp) && metaProp.size ()) -+ _handleMetaTag ("Keywords", metaProp); -+ -+ if (m_pDocument->getMetaDataProp (PD_META_KEY_SUBJECT, metaProp) && metaProp.size ()) -+ _handleMetaTag ("Subject", metaProp); -+ } -+} -+ -+#endif /* HTML_META_SUPPORTED */ -+ -+bool s_TemplateHandler::echo () const -+{ -+ if (!m_mode.getDepth ()) -+ return true; -+ -+ UT_sint32 mode; -+ m_mode.viewTop (mode); -+ -+ return (mode == 0); -+} -+ -+bool s_TemplateHandler::condition (const gchar * data) const -+{ -+ const char * eq = strstr (data, "=="); -+ const char * ne = strstr (data, "!="); -+ -+ if (!eq && !ne) -+ return false; -+ if (eq && ne) -+ { -+ if (eq < ne) -+ ne = 0; -+ else -+ eq = 0; -+ } -+ -+ UT_UTF8String var; -+ const char * value = NULL; -+ -+ if (eq) -+ { -+ var.assign (data, eq - data); -+ value = eq + 2; -+ } -+ else -+ { -+ var.assign (data, ne - data); -+ value = ne + 2; -+ } -+ const std::string & prop = m_pie->getProperty (var.utf8_str ()); -+ -+ bool match; -+ -+ match = (prop == value); -+ -+ return (eq ? match : !match); -+} -+ -+void s_TemplateHandler::Comment (const gchar * data) -+{ -+ if (!echo ()) return; -+ -+ if (m_empty) -+ { -+ m_pie->write (">", 1); -+ m_empty = false; -+ } -+ m_pie->write ("", 3); -+} -+ -+void s_TemplateHandler::StartCdataSection () -+{ -+ if (!echo ()) return; -+ -+ if (m_empty) -+ { -+ m_pie->write (">", 1); -+ m_empty = false; -+ } -+ m_pie->write ("write (">", 1); -+ m_empty = false; -+ } -+ m_pie->write ("]]>", 3); -+ m_cdata = false; -+} -+ -+void s_TemplateHandler::Default (const gchar * buffer, int length) -+{ -+ // do nothing -+} -+ -+/*****************************************************************/ -+/*****************************************************************/ -+ -+IE_Exp_HTML::IE_Exp_HTML (PD_Document * pDocument) -+ : IE_Exp(pDocument), -+ m_style_tree(new s_StyleTree(pDocument)), -+ m_bSuppressDialog(false) -+{ -+ m_exp_opt.bIs4 = false; -+ m_exp_opt.bIsAbiWebDoc = false; -+ m_exp_opt.bDeclareXML = true; -+ m_exp_opt.bAllowAWML = true; -+ m_exp_opt.bEmbedCSS = true; -+ m_exp_opt.bLinkCSS = false; -+ m_exp_opt.bEmbedImages = false; -+ m_exp_opt.bMultipart = false; -+ m_exp_opt.bClassOnly = false; -+ m_exp_opt.bAbsUnits = false; -+ m_exp_opt.iCompact = 0; -+ -+ m_error = UT_OK; -+ -+#ifdef HTML_DIALOG_OPTIONS -+ XAP_Dialog_HTMLOptions::getHTMLDefaults (&m_exp_opt, pDocument->getApp ()); -+#endif -+} -+ -+IE_Exp_HTML::~IE_Exp_HTML () -+{ -+ DELETEP(m_style_tree); -+} -+ -+void IE_Exp_HTML::_buildStyleTree () -+{ -+ const PD_Style * p_pds = 0; -+ const gchar * szStyleName = 0; -+ -+ UT_GenericVector * pStyles = NULL; -+ getDoc()->enumStyles(pStyles); -+ UT_return_if_fail( pStyles ); -+ UT_uint32 iStyleCount = getDoc()->getStyleCount(); -+ -+ for (size_t n = 0; n < iStyleCount; n++) -+ { -+ p_pds = pStyles->getNthItem(n); -+ UT_return_if_fail( p_pds ); -+ -+ szStyleName = p_pds->getName(); -+ -+ if (p_pds == 0) continue; -+ -+ PT_AttrPropIndex api = p_pds->getIndexAP (); -+ -+ const PP_AttrProp * pAP_style = 0; -+ bool bHaveProp = getDoc()->getAttrProp (api, &pAP_style); -+ -+ if (bHaveProp && pAP_style /* && p_pds->isUsed () */) // can't trust ->isUsed() :-( -+ { -+ m_style_tree->add (szStyleName, getDoc ()); -+ } -+ } -+ -+ delete pStyles; -+ -+ if (isCopying ()) // clipboard -+ getDoc()->tellListenerSubset (m_style_tree, getDocRange ()); -+ else -+ getDoc()->tellListener (m_style_tree); -+} -+ -+UT_Error IE_Exp_HTML::_doOptions () -+{ -+#ifdef HTML_DIALOG_OPTIONS -+ XAP_Frame * pFrame = getDoc()->getApp()->getLastFocussedFrame (); -+ -+ if (m_bSuppressDialog || !pFrame || isCopying ()) return UT_OK; -+ if(pFrame) -+ { -+ AV_View * pView = pFrame->getCurrentView(); -+ if(pView) -+ { -+ GR_Graphics * pG = pView->getGraphics(); -+ if(pG && pG->queryProperties(GR_Graphics::DGP_PAPER)) -+ { -+ return UT_OK; -+ } -+ } -+ } -+ /* run the dialog -+ */ -+ -+ XAP_Dialog_Id id = XAP_DIALOG_ID_HTMLOPTIONS; -+ -+ XAP_DialogFactory * pDialogFactory -+ = static_cast(getDoc()->getApp()->getDialogFactory ()); -+ -+ XAP_Dialog_HTMLOptions * pDialog -+ = static_cast(pDialogFactory->requestDialog (id)); -+ -+ UT_return_val_if_fail (pDialog, false); -+ -+ pDialog->setHTMLOptions (&m_exp_opt, getDoc()->getApp ()); -+ -+ pDialog->runModal (pFrame); -+ -+ /* extract what they did -+ */ -+ bool bSave = pDialog->shouldSave (); -+ -+ pDialogFactory->releaseDialog (pDialog); -+ -+ if (!bSave) -+ { -+ return UT_SAVE_CANCELLED; -+ } -+#endif -+ return UT_OK; -+} -+ -+UT_Error IE_Exp_HTML::_writeDocument () -+{ -+ UT_Error errOptions = _doOptions(); -+ -+ if (errOptions == UT_SAVE_CANCELLED) //see Bug 10840 -+ { -+ return UT_SAVE_CANCELLED; -+ } -+ else if (errOptions != UT_OK) -+ { -+ return UT_ERROR; -+ } -+ -+ _buildStyleTree (); -+ -+ if (isCopying ()) // ClipBoard -+ { -+ m_exp_opt.bEmbedImages = true; -+ return _writeDocument (true, false); -+ } -+ -+ /* Export options: -+ -+ html4 yes | no whether to write HTML4 or XHTML -+ php-includes yes | no whether to add styles in external sheet, insert -+ appropriate statement, do not -+ export any style definition in the document -+ class-only yes | no if text is formated with style, export only -+ style name (class="style name") ignoring -+ any explicit fmt properties -+ embed-images yes | no whether to embed images in URLs -+ html-template use as template for output -+ href-prefix use as prefix for template href attributes marked with initial '$' -+ title can contain the following special tokens -+ %n - file name without extension -+ %f - file name with extension -+ %F - file name including full path -+ abs-units yes | no use absolute rather than relative units in tables, etc. (defaults to no units) -+ scale-units yes | no use scale (relative) rather than absolute units in tables, etc. (defaults to no units) -+ compact yes | no | number -- if set we avoid ouputing unnecessary whitespace; numerical value -+ indicates max line length (default MAX_LINE_LEN) -+ */ -+ -+ std::string prop; -+ -+ prop = getProperty ("html4"); -+ if (!prop.empty()) -+ m_exp_opt.bIs4 = UT_parseBool (prop.c_str (), m_exp_opt.bIs4); -+ -+ prop = getProperty ("php-includes"); -+ if (!prop.empty()) -+ m_exp_opt.bIsAbiWebDoc = UT_parseBool (prop.c_str (), m_exp_opt.bIsAbiWebDoc); -+ -+ prop = getProperty ("declare-xml"); -+ if (!prop.empty()) -+ m_exp_opt.bDeclareXML = UT_parseBool (prop.c_str (), m_exp_opt.bDeclareXML); -+ -+ prop = getProperty ("use-awml"); -+ if (!prop.empty()) -+ m_exp_opt.bAllowAWML = UT_parseBool (prop.c_str (), m_exp_opt.bAllowAWML); -+ -+ prop = getProperty ("embed-css"); -+ if (!prop.empty()) -+ m_exp_opt.bEmbedCSS = UT_parseBool (prop.c_str (), m_exp_opt.bEmbedCSS); -+ -+ prop = getProperty ("abs-units"); -+ if (!prop.empty()) -+ m_exp_opt.bAbsUnits = UT_parseBool (prop.c_str (), m_exp_opt.bAbsUnits); -+ -+ prop = getProperty ("compact"); -+ if (!prop.empty()) -+ { -+ UT_sint32 iLen = atoi(prop.c_str()); -+ if(iLen != 0) -+ m_exp_opt.iCompact = (UT_uint32)iLen; -+ else -+ { -+ m_exp_opt.iCompact = (UT_uint32)UT_parseBool (prop.c_str (), (bool)m_exp_opt.iCompact); -+ if(m_exp_opt.iCompact) -+ m_exp_opt.iCompact = MAX_LINE_LEN; -+ } -+ } -+ -+ -+ prop = getProperty ("link-css"); -+ if (!prop.empty()) -+ { -+ m_exp_opt.bEmbedCSS = false; -+ m_exp_opt.bLinkCSS = true; -+ m_sLinkCSS = prop; -+ } -+ -+ prop = getProperty ("class-only"); -+ if (!prop.empty() && !g_ascii_strcasecmp("yes",prop.c_str())) -+ { -+ m_exp_opt.bClassOnly = true; -+ } -+ -+ prop = getProperty ("title"); -+ if(!prop.empty()) -+ { -+ m_sTitle.clear(); -+ // FIXME: less optimal -- hub -+ UT_UTF8String utf8prop(prop.c_str()); -+ -+ UT_UTF8Stringbuf::UTF8Iterator propIt = utf8prop.getIterator(); -+ -+ UT_UCS4Char c = UT_UTF8Stringbuf::charCode(propIt.current()); -+ bool bToken = false; -+ -+ while(c) -+ { -+ if(bToken) -+ { -+ const char * fname = getDoc()->getFilename(); -+ if(fname) -+ { -+ const char * base = UT_basename(fname); -+ UT_uint32 iNameLen = strlen(base); -+ -+ const char * dot = strrchr(base, '.'); -+ if(dot) -+ { -+ iNameLen = dot - base; -+ } -+ -+ switch(c) -+ { -+ case 'n': -+ m_sTitle.append(base, iNameLen); -+ break; -+ -+ case 'f': -+ m_sTitle += base; -+ break; -+ -+ case 'F': -+ m_sTitle += fname; -+ break; -+ -+ default: -+ m_sTitle.appendUCS4(&c,1); -+ } -+ } -+ -+ bToken = false; -+ } -+ else if(c == '%') -+ { -+ bToken = true; -+ //m_sTitle.appendUCS4(&c,1); -+ } -+ else -+ { -+ m_sTitle.appendUCS4(&c,1); -+ } -+ -+ c = UT_UTF8Stringbuf::charCode(propIt.advance()); -+ } -+ } -+ -+ -+ -+ prop = getProperty ("embed-images"); -+ if (!prop.empty()) -+ m_exp_opt.bEmbedImages = UT_parseBool(prop.c_str(), m_exp_opt.bEmbedImages); -+ -+ prop = getProperty ("html-template"); -+ if (prop.empty()) -+ return _writeDocument (false, false); -+ -+ /* template mode... -+ */ -+ m_exp_opt.bIs4 = false; -+ -+ UT_UTF8String declaration; -+ -+ if (m_exp_opt.bDeclareXML) -+ declaration += "" MYEOL; -+ -+ declaration += "<"; -+ declaration += s_DTD_XHTML; -+ declaration += ">" MYEOL; -+ -+ write (declaration.utf8_str (), declaration.byteLength ()); -+ -+ s_TemplateHandler TH(getDoc(),this); -+ -+ UT_XML parser; -+ parser.setExpertListener (&TH); -+ -+ UT_Error err = parser.parse (prop.c_str ()); -+ -+ return err; -+} -+ -+UT_Error IE_Exp_HTML::_writeDocument (bool bClipBoard, bool bTemplateBody) -+{ -+ s_HTML_Listener * pListener = new s_HTML_Listener(getDoc(),this,bClipBoard,bTemplateBody, -+ &m_exp_opt,m_style_tree, -+ m_sLinkCSS, m_sTitle); -+ if (pListener == 0) return UT_IE_NOMEMORY; -+ -+ PL_Listener * pL = static_cast(pListener); -+ -+ bool okay = true; -+ -+ s_HTML_HdrFtr_Listener * pHdrFtrListener = new s_HTML_HdrFtr_Listener(getDoc(),this, pL); -+ if (pHdrFtrListener == 0) return UT_IE_NOMEMORY; -+ PL_Listener * pHFL = static_cast(pHdrFtrListener); -+ -+ if(!bClipBoard) -+ { -+ okay = getDoc()->tellListener (pHFL); -+ pHdrFtrListener->doHdrFtr(1); -+ } -+ -+ if (bClipBoard) -+ { -+ okay = getDoc()->tellListenerSubset (pL, getDocRange ()); -+ } -+ else if (okay) { -+ okay = getDoc()->tellListener (pL); -+ if(okay) okay = pListener->endOfDocument(); -+ } -+ -+ if(!bClipBoard) -+ pHdrFtrListener->doHdrFtr(0); // Emit footer -+ -+ DELETEP(pListener); -+ DELETEP(pHdrFtrListener); -+ -+ if ((m_error == UT_OK) && (okay == true)) return UT_OK; -+ return UT_IE_COULDNOTWRITE; -+} -+ -+void s_HTML_Listener::addFootnote(PD_DocumentRange * pDocRange) -+{ -+ m_vecFootnotes.addItem(pDocRange); -+} -+ -+void s_HTML_Listener::addEndnote(PD_DocumentRange * pDocRange) -+{ -+ m_vecEndnotes.addItem(pDocRange); -+} -+ -+UT_uint32 s_HTML_Listener::getNumFootnotes(void) -+{ -+ return m_vecFootnotes.getItemCount(); -+} -+ -+UT_uint32 s_HTML_Listener::getNumEndnotes(void) -+{ -+ return m_vecEndnotes.getItemCount(); -+} -+ -+void s_HTML_Listener::setHaveHeader() -+{ -+ m_bHaveHeader = true; -+} -+ -+void s_HTML_Listener::setHaveFooter() -+{ -+ m_bHaveFooter = true; -+} -diff -urNad abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_exp_RTF_listenerWriteDoc.cpp abiword-2.6.2/abiword/src/wp/impexp/xp/ie_exp_RTF_listenerWriteDoc.cpp ---- abiword-2.6.2~/abiword/src/wp/impexp/xp/ie_exp_RTF_listenerWriteDoc.cpp 2008-04-17 13:12:33.000000000 +0200 -+++ abiword-2.6.2/abiword/src/wp/impexp/xp/ie_exp_RTF_listenerWriteDoc.cpp 2008-04-17 21:45:40.000000000 +0200 -@@ -2567,7 +2567,7 @@ - { - iColor = m_pie->_findOrAddColor(m_sLastColor.c_str()); - } -- else if(strcmp (sWork.c_str(), "transperent") == 0) -+ else if(strcmp (sWork.c_str(), "transparent") == 0) - { - bWriteColor = false; - iColor = m_pie->_findOrAddColor(sWork.c_str()); -@@ -2596,7 +2596,7 @@ - { - iColor = m_pie->_findOrAddColor(m_sLastColor.c_str()); - } -- else if(strcmp (sWork.c_str(), "transperent") == 0) -+ else if(strcmp (sWork.c_str(), "transparent") == 0) - { - bWriteColor = false; - iColor = m_pie->_findOrAddColor(sWork.c_str()); -@@ -2697,7 +2697,7 @@ - { - iColor = m_pie->_findOrAddColor(m_sLastColor.c_str()); - } -- else if(strcmp (sWork.c_str(), "transperent") == 0) -+ else if(strcmp (sWork.c_str(), "transparent") == 0) - { - bWriteColor = false; - iColor = m_pie->_findOrAddColor(sWork.c_str()); -@@ -2782,7 +2782,7 @@ - { - iColor = m_pie->_findOrAddColor(m_sLastColor.c_str()); - } -- else if(strcmp (sWork.c_str(), "transperent") == 0) -+ else if(strcmp (sWork.c_str(), "transparent") == 0) - { - bWriteColor = false; - iColor = m_pie->_findOrAddColor(sWork.c_str()); -@@ -2867,7 +2867,7 @@ - { - iColor = m_pie->_findOrAddColor(m_sLastColor.c_str()); - } -- else if(strcmp (sWork.c_str(), "transperent") == 0) -+ else if(strcmp (sWork.c_str(), "transparent") == 0) - { - bWriteColor = false; - iColor = m_pie->_findOrAddColor(sWork.c_str()); -diff -urNad abiword-2.6.2~/abiword/user/wp/templates/normal.awt-de_CH abiword-2.6.2/abiword/user/wp/templates/normal.awt-de_CH ---- abiword-2.6.2~/abiword/user/wp/templates/normal.awt-de_CH 2008-04-17 13:12:31.000000000 +0200 -+++ abiword-2.6.2/abiword/user/wp/templates/normal.awt-de_CH 2008-04-17 21:45:40.000000000 +0200 -@@ -1,6 +1,6 @@ - - -- -+ - - - -diff -urNad abiword-2.6.2~/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.cpp abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.cpp ---- abiword-2.6.2~/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.cpp 2008-04-17 13:12:31.000000000 +0200 -+++ abiword-2.6.2/abiword-plugins/wp/impexp/OpenDocument/imp/xp/ODi_ListLevelStyle.cpp 2008-04-17 21:46:47.000000000 +0200 -@@ -61,14 +61,17 @@ - !strcmp("text:list-level-style-number", pName) || - !strcmp("text:list-level-style-image", pName)) { - -- UT_uint32 result; -+ UT_uint32 result = 0; - - pVal = UT_getAttribute ("text:level", ppAtts); -- UT_ASSERT(pVal); - -- result = sscanf(pVal, "%u", &m_levelNumber); -- UT_ASSERT(result==1); -- m_level = pVal; -+ if (pVal) { -+ result = sscanf(pVal, "%u", &m_levelNumber); -+ // TODO: check result? -+ m_level = pVal; -+ } else { -+ UT_DEBUGMSG(("ODi_ListLevelStyle::startElement: missing text:level attribute\n")); -+ } - - pVal = UT_getAttribute ("text:style-name", ppAtts); - if (pVal) { diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/README.Debian /tmp/qY2gb79Nml/abiword-2.6.4/debian/README.Debian --- abiword-2.6.2/debian/README.Debian 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/README.Debian 2008-07-18 04:24:35.000000000 +0100 @@ -1,3 +1,24 @@ -abiword for Ubuntu -------------------- +abiword for Debian +------------------ +Smooth scrolling issue +====================== + +Debian bug #276070 complains that smooth-scrolling is obnoxious and slow. +As of 2.6.3-1, it has been disabled by default using a patch. However, if +you are a previous AbiWord user, your preferences file may have the smooth +scroll setting set to true in your config file, overriding the default. + +To fix this, I quote from the AbiWord ML: + +"I think you can turn this feature off with a profile change. Open up +your AbiWord.Profile file and in the custom scheme section ( Fri, 11 Jul 2008 14:08:34 +0300 diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/README.source /tmp/qY2gb79Nml/abiword-2.6.4/debian/README.source --- abiword-2.6.2/debian/README.source 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/README.source 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -To produce the .orig.tar.gz source package, untar all four upstream tarballs, -remove the versions from the unzipped directory names, and then create the new -tarball. diff -Nru /tmp/GY3Z5Jb0l4/abiword-2.6.2/debian/rules /tmp/qY2gb79Nml/abiword-2.6.4/debian/rules --- abiword-2.6.2/debian/rules 2008-07-18 04:24:34.000000000 +0100 +++ abiword-2.6.4/debian/rules 2008-07-18 04:24:35.000000000 +0100 @@ -11,6 +11,13 @@ DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +# Should be synced up. +ABIWORD_SERIES = 2.6 + +COMMON_STAGE = debian/abiword-common +LIB_DIR = $(COMMON_STAGE)/usr/lib/abiword-$(ABIWORD_SERIES) +SHARE_DIR = $(COMMON_STAGE)/usr/share/abiword-$(ABIWORD_SERIES) + # Include dpatch stuff. include /usr/share/dpatch/dpatch.make @@ -29,6 +36,7 @@ configure-stamp: dh_testdir + # Add here commands to configure the package. # # Configure @@ -39,7 +47,10 @@ --disable-gucharmap \ --disable-gnomeui \ --disable-gnomevfs \ - --without-goffice + --without-goffice + + # Pre-build abiword-2.6.pc + cd $(CURDIR)/build && $(MAKE) abiword-$(ABIWORD_SERIES).pc # # Configure plugins @@ -49,15 +60,14 @@ ../abiword-plugins/configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \ --disable-gremlin --disable-abicapi --disable-gda - # # Configure extras # we must re-autogen.sh due to patch 04, correcting the pkg-config for abiword # [ -d $(CURDIR)/build-extras ] || mkdir $(CURDIR)/build-extras cd $(CURDIR)/build-extras && \ - PKG_CONFIG_PATH=$(CURDIR)/build ../abiword-extras/autogen.sh --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr - touch configure-stamp + PKG_CONFIG_PATH=$(CURDIR)/build ../abiword-extras/configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr + touch $@ build: patch build-stamp @@ -68,8 +78,6 @@ $(MAKE) -C $(CURDIR)/build $(MAKE) -C $(CURDIR)/build-plugins $(MAKE) -C $(CURDIR)/build-extras - # create the pot files - (cd $(CURDIR)/abiword/po/; ./update.pl -P) touch $@ @@ -79,8 +87,8 @@ rm -f build-stamp configure-stamp build-doc-stamp # Add here commands to clean up after the build process. - -$(MAKE) -C $(CURDIR)/abiword/src realclean - -$(MAKE) -C $(CURDIR)/abiword realclean + $(MAKE) -C $(CURDIR)/abiword/src realclean + $(MAKE) -C $(CURDIR)/abiword realclean rm -rf $(CURDIR)/abiword-docs/help rm -rf $(CURDIR)/build rm -rf $(CURDIR)/build-plugins @@ -98,50 +106,66 @@ install: build dh_testdir dh_testroot - dh_clean -k + + dh_clean -k -Xstamp + rm -f debian/files + dh_installdirs # Add here commands to install the package into debian/abiword. - $(MAKE) -C $(CURDIR)/build-plugins install DESTDIR=$(CURDIR)/debian/abiword - $(MAKE) -C $(CURDIR)/build install DESTDIR=$(CURDIR)/debian/abiword - $(MAKE) -C $(CURDIR)/build-extras install DESTDIR=$(CURDIR)/debian/abiword + $(MAKE) -C $(CURDIR)/build-plugins install DESTDIR=$(CURDIR)/debian/abiword-common + $(MAKE) -C $(CURDIR)/build install DESTDIR=$(CURDIR)/debian/abiword-common + $(MAKE) -C $(CURDIR)/build-extras install DESTDIR=$(CURDIR)/debian/abiword-common # Make abw2html.pl executable - chmod 755 $(CURDIR)/debian/abiword/usr/share/abiword-2.6/scripts/abw2html.pl + chmod 755 $(SHARE_DIR)/scripts/abw2html.pl # Remove upstream-obsoleted ttfadmin/ttftool - rm -f debian/abiword/usr/bin/ttf* + rm -f $(COMMON_STAGE)/usr/bin/ttf* # Remove development files - rm -rf debian/abiword/usr/lib/pkgconfig - rm -rf debian/abiword/usr/include - rm -f debian/abiword/usr/lib/abiword-2.6/plugins/*.la + rm -rf $(COMMON_STAGE)/usr/lib/pkgconfig + rm -rf $(COMMON_STAGE)/usr/include + rm -f $(LIB_DIR)/plugins/*.la # Install GNOME/KDE menu files. install -m 644 $(CURDIR)/debian/misc/AbiWord.applications $(CURDIR)/debian/abiword/usr/share/application-registry/abiword.applications install -m 644 $(CURDIR)/debian/misc/AbiWord.keys $(CURDIR)/debian/abiword/usr/share/mime-info/abiword.keys install -m 644 $(CURDIR)/debian/misc/AbiWord.mime $(CURDIR)/debian/abiword/usr/share/mime-info/abiword.mime - install -m 644 $(CURDIR)/abiword/abiword.desktop $(CURDIR)/debian/abiword/usr/share/applications/abiword.desktop - - # Install GNOME/KDE menu files. (plugins) - install -m 644 $(CURDIR)/debian/misc/AbiWord.applications.plugins $(CURDIR)/debian/abiword-plugins/usr/share/application-registry/abiword.applications - install -m 644 $(CURDIR)/debian/misc/AbiWord.keys.plugins $(CURDIR)/debian/abiword-plugins/usr/share/mime-info/abiword.keys - install -m 644 $(CURDIR)/debian/misc/AbiWord.mime.plugins $(CURDIR)/debian/abiword-plugins/usr/share/mime-info/abiword.mime - - # right now abiword-plugins adds no mimetypes - install -m 644 $(CURDIR)/abiword/abiword.desktop $(CURDIR)/debian/abiword-plugins/usr/share/applications/abiword.desktop # Move auxiliary files. - mv -f $(CURDIR)/debian/abiword/usr/share/icons/abiword_48.png $(CURDIR)/debian/abiword/usr/share/pixmaps/abiword.png + mv -f $(COMMON_STAGE)/usr/share/icons/abiword_48.png \ + $(COMMON_STAGE)/usr/share/pixmaps/abiword.png + rmdir $(COMMON_STAGE)/usr/share/icons + + # Move plugin files away. + mv -f $(LIB_DIR)/plugins/libAbiGrammar.so \ + debian/abiword-plugin-grammar/usr/lib/abiword-$(ABIWORD_SERIES)/plugins/ + mv -f $(LIB_DIR)/plugins/libAbiMathView.so \ + debian/abiword-plugin-mathview/usr/lib/abiword-$(ABIWORD_SERIES)/plugins/ + mv -f $(LIB_DIR)/plugins/libAbiGOffice.so \ + debian/abiword-plugin-goffice/usr/lib/abiword-$(ABIWORD_SERIES)/plugins/ + + # Move abiword's files away. + dh_movefiles --sourcedir=debian/abiword-common + + # Clean up some empty directories. + rm -rf $(LIB_DIR) \ + debian/abiword-common/usr/share/applications \ + debian/abiword-common/usr/bin \ + debian/abiword-common/usr/lib + + # Clean up some silly symlinks. + rm -f debian/abiword/usr/share/man/man1/AbiWord-2.6.1.gz - # Separate Plugins - dh_movefiles -pabiword-plugins-gnome --sourcedir=debian/abiword - dh_movefiles -Nabiword-plugins-gnome --sourcedir=debian/abiword + # Clean up abiword's .keys file, as it doesn't handle all the MIME types + # we ship with. + rm -rf debian/abiword-common/usr/share/mime-info build-doc: build-doc-stamp -build-doc-stamp: build +build-doc-stamp: build-stamp # Generate online documentation cd abiword-docs && DISPLAY=NONE ABI_DOC_PROG="$(CURDIR)/build/src/wp/main/unix/abiword" ./make-html.sh touch $@ @@ -150,7 +174,7 @@ binary-indep: build build-doc install # Install online help files. cp -a $(CURDIR)/abiword-docs/help/en-US $(CURDIR)/debian/abiword-help/usr/share/doc/abiword-help/html - ln -s $(CURDIR)/debian/abiword-help/usr/share/doc/abiword-help/html $(CURDIR)/debian/abiword-help/usr/share/abiword-2.6/help/en-US + ln -sf /usr/share/doc/abiword-help/html $(CURDIR)/debian/abiword-help/usr/share/abiword-2.6/help/en-US dh_testdir -i dh_testroot -i @@ -159,6 +183,7 @@ dh_installmenu -i dh_installchangelogs -i dh_installmime -i + dh_desktop -i dh_link -i dh_compress -i dh_fixperms -i @@ -175,6 +200,7 @@ dh_installman -a dh_installchangelogs -a dh_installmime -a + dh_desktop -a dh_link -a dh_strip -a dh_compress -a