office-gobmx/sw
Miklos Vajna bbef85c157 bnc#779620 DOCX import: try harder to convert floating tables to text frames
Since 78d1f1c283, we convert floating
tables to text frames only in case it's possible that there will be
wrapping, to give better results for multi-page tables, which are
multi-page, and technically floating ones, but that has no effect on the
layout.

The problem was that we try to do this decision too early, effectively
the page width and margins were counted from the default letter size,
instead of the actual values, which did not arrive at the time of the
decision. Fix this by moving this logic at the section end.

Change-Id: Ic1fbceb54c8ec223ed01836fafe6220bb3b2410a
2013-10-01 17:28:18 +02:00
..
inc Related: fdo#38838 remove UniString::AssignAscii 2013-10-01 14:19:25 +01:00
qa bnc#779620 DOCX import: try harder to convert floating tables to text frames 2013-10-01 17:28:18 +02:00
sdi
source Related: fdo#38838 remove UniString::AssignAscii 2013-10-01 14:19:25 +01:00
uiconfig convert mail merge outputtype page to .ui 2013-09-28 20:58:15 +01:00
util
AllLangResTarget_sw.mk convert mail merge outputtype page to .ui 2013-09-28 20:58:15 +01:00
CppunitTest_sw_filters_test.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_htmlexport.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_layout_test.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_macros_test.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_odfexport.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_odfimport.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_ooxmlexport.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_ooxmlimport.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_rtfexport.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_rtfimport.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_uwriter.mk
CppunitTest_sw_ww8export.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
CppunitTest_sw_ww8import.mk gbuild: use .xcd configuration files from instdir 2013-10-01 10:54:14 +00:00
JunitTest_sw_complex.mk
JunitTest_sw_unoapi.mk
Library_msword.mk
Library_sw.mk gbuild: add gb_Library_use_restarget 2013-09-22 11:08:28 +02:00
Library_swd.mk
Library_swui.mk convert mail merge subject/attachment dialogs to .ui 2013-09-19 12:12:38 +01:00
Library_vbaswobj.mk
Makefile
Module_sw.mk make the PythonTest run on WNT 2013-09-22 11:08:34 +02:00
PythonTest_sw_python.mk
README
UIConfig_sglobal.mk
UIConfig_sweb.mk
UIConfig_swform.mk
UIConfig_swreport.mk
UIConfig_swriter.mk convert mail merge outputtype page to .ui 2013-09-28 20:58:15 +01:00
UIConfig_swxform.mk

Writer application code.

Exact history was lost before Sept. 18th, 2000, but old source code
comments show that Writer core dates back until at least November
1990.

== Module contents ==
 * inc: headers available to all source files inside the module
 * qa: unit, slow and subsequent tests
 * sdi
 * source: see below
 * uiconfig: user interface configuration
 * util: UNO passive registration config

== Source contents ==
 * core: Writer core (document model, layout, UNO API implementation)
 * filter: Writer internal filters
   * ascii: plan text filter
   * basflt
   * html: HTML filter
   * inc: include files for filters
   * rtf: thin copy&paste helper around the UNO RTF import filter (in writerfilter)
   * writer
   * ww1
   * ww8: DOC import, DOC/DOCX/RTF export
   * xml: ODF import/export, subclassed from xmloff (where most of the work is done)
 * ui: user interface

== Core ==

There is a good overview documentation of basic architecture of Writer core
in the OOo wiki:

http://wiki.openoffice.org/wiki/Writer/Core_And_Layout
http://wiki.openoffice.org/wiki/Writer/Text_Formatting

Writer specific WhichIds are defined in sw/inc/hintids.hxx.

The details below are mainly about details missing from the Wiki pages.

=== SwDoc ===

The central class for a document is SwDoc, which represents a document.

This is a huge class with hundreds of methods; there are some efforts
to split up the class into many smaller classes that implement more
specific interfaces but this is not fully implemented yet; see the various
IDocument* classes.

=== SwNodes ===

Basically a (fancy) array of SwNode pointers.  There are special subclasses of
SwNode (SwStartNode and SwEndNode) which are used to encode a nested tree
structure into the flat array; the range of nodes from SwStartNode to its
corresponding SwEndNode is sometimes called a "section" (but is not necessarily
what the high-level document model calls a "Section"; that is just one of the
possibilities).

The SwNodes contains the following top-level sections:

1. Empty
2. Footnote content
3. Frame / Header / Footer content
4. Deleted Change Tracking content
5. Body content

=== Undo ===

The Undo/Redo information is stored in a sw::UndoManager member of SwDoc,
which implements the IDocumentUndoRedo interface.
Its members include a SwNodes array containing the document content that
is currently not in the actual document but required for Undo/Redo, and
a stack of SwUndo actions, each of which represents one user-visible
Undo/Redo step.

There are also ListActions which internally contain several individual SwUndo
actions; these are created by the StartUndo/EndUndo wrapper methods.

=== Text Attributes ===

The sub-structure of paragraphs is stored in the SwpHintsArray member
SwTxtNode::m_pSwpHints.  There is a base class SwTxtAttr with numerous
subclasses; the SwTxtAttr has a start and end index and a SfxPoolItem
to store the actual formatting attribute.

There are several sub-categories of SwTxtAttr:

- formatting attributes: Character Styles (SwTxtCharFmt, RES_TXTATR_CHARFMT)
  and Automatic Styles (no special class, RES_TXTATR_AUTOFMT):
  these are handled by SwpHintsArray::BuildPortions and MergePortions,
  which create non-overlapping portions of formatting attributes.

- nesting attributes: Hyperlinks (SwTxtINetFmt, RES_TXTATR_INETFMT),
  Ruby (SwTxtRuby, RES_TXTATR_CJK_RUBY) and Meta/MetaField (SwTxtMeta,
  RES_TXTATR_META/RES_TXTATR_METAFIELD):
  these maintain a properly nested tree structure.
  The Meta/Metafield are "special" because they have both start/end
  and a dummy character at the start.

- misc. attributes: Reference Marks, ToX Marks

- attributes without end: Fields, Footnotes, Flys (AS_CHAR)
  These all have a corresponding dummy character in the paragraph text, which
  is a placeholder for the "expansion" of the attribute, e.g. field content.