]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes to HTML tables alignment
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 10 Feb 2002 23:43:34 +0000 (23:43 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 10 Feb 2002 23:43:34 +0000 (23:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/html/m_tables.cpp

index bd2c9656dfe65a1f484bbd82309f387cff040033..716f5ae799cdcf235d79b9ef40d3364d688954b3 100644 (file)
@@ -130,6 +130,7 @@ wxHTML:
 - fixed wxHtmlHelpController's cache files handling on big endian machines
 - added blocking and redirecting capabilities to wxHtmlWindow via
   wxHtmlWindow::OnOpeningURL()
+- fixed alignment handling in tables
 
 2.3.2
 -----
index adc0620081672c28043fdccd60dd102b6c70957b..7d125edf1c82bab15250188d7584694d7a9fb355 100644 (file)
@@ -524,13 +524,11 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
     TAG_HANDLER_VARS
         wxHtmlTableCell* m_Table;
         wxString m_tAlign, m_rAlign;
-        int m_OldAlign;
 
     TAG_HANDLER_CONSTR(TABLE)
     {
         m_Table = NULL;
         m_tAlign = m_rAlign = wxEmptyString;
-        m_OldAlign = wxHTML_ALIGN_LEFT;
     }
 
 
@@ -548,14 +546,14 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
 
             c->SetWidthFloat(tag, m_WParser->GetPixelScale());
             m_Table = new wxHtmlTableCell(c, tag, m_WParser->GetPixelScale());
-            m_OldAlign = m_WParser->GetAlign();
+            int oldAlign = m_WParser->GetAlign();
             m_tAlign = wxEmptyString;
             if (tag.HasParam(wxT("ALIGN")))
                 m_tAlign = tag.GetParam(wxT("ALIGN"));
 
             ParseInner(tag);
 
-            m_WParser->SetAlign(m_OldAlign);
+            m_WParser->SetAlign(oldAlign);
             m_WParser->SetContainer(oldcont);
             m_WParser->CloseContainer();
             
@@ -578,29 +576,29 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
             // new cell
             else
             {
-                m_WParser->SetAlign(m_OldAlign);
                 c = m_WParser->SetContainer(new wxHtmlContainerCell(m_Table));
                 m_Table->AddCell(c, tag);
 
                 m_WParser->OpenContainer();
 
                 if (tag.GetName() == wxT("TH")) /*header style*/
-                {
                     m_WParser->SetAlign(wxHTML_ALIGN_CENTER);
-                }
-
-                {
-                    wxString als;
-
-                    als = m_rAlign;
-                    if (tag.HasParam(wxT("ALIGN")))
-                        als = tag.GetParam(wxT("ALIGN"));
-                    als.MakeUpper();
-                    if (als == wxT("RIGHT"))
-                        m_WParser->SetAlign(wxHTML_ALIGN_RIGHT);
-                    else if (als == wxT("CENTER"))
-                        m_WParser->SetAlign(wxHTML_ALIGN_CENTER);
-                }
+                else
+                    m_WParser->SetAlign(wxHTML_ALIGN_LEFT);
+
+                wxString als;
+
+                als = m_rAlign;
+                if (tag.HasParam(wxT("ALIGN")))
+                    als = tag.GetParam(wxT("ALIGN"));
+                als.MakeUpper();
+                if (als == wxT("RIGHT"))
+                    m_WParser->SetAlign(wxHTML_ALIGN_RIGHT);
+                else if (als == wxT("LEFT"))
+                    m_WParser->SetAlign(wxHTML_ALIGN_LEFT);
+                else if (als == wxT("CENTER"))
+                    m_WParser->SetAlign(wxHTML_ALIGN_CENTER);
+
                 m_WParser->OpenContainer();
             }
         }