OSDN Git Service

reformat.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Wed, 20 Jun 2007 15:33:14 +0000 (15:33 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Wed, 20 Jun 2007 15:33:14 +0000 (15:33 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1980 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/thread/htmlpart.cpp

index 7ba8a67..df444d5 100644 (file)
@@ -67,7 +67,6 @@ KitaHTMLPart::~KitaHTMLPart()
 /* private */
 void KitaHTMLPart::clearPart()
 {
-
     slotDeletePopup();
 
     /* delete KitaDomTree */
@@ -106,6 +105,7 @@ void KitaHTMLPart::clearPart()
             emit updateSubjectTab( m_datURL );
         }
     }
+
     m_datURL = QString::null;
     m_mode = HTMLPART_MODE_MAINPART;
 }
@@ -155,10 +155,8 @@ bool KitaHTMLPart::setup( int mode, const KURL& url )
 /* private */
 void KitaHTMLPart::connectSignals()
 {
-
     Kita::SignalCollection * signalCollection = Kita::SignalCollection::getInstance();
 
-
     /* rendering */
     connect( this, SIGNAL( redrawHTMLPart( const KURL&, bool ) ), signalCollection, SIGNAL( redrawHTMLPart( const KURL&, bool ) ) );
     connect( signalCollection, SIGNAL( redrawHTMLPart( const KURL&, bool ) ), SLOT( slotRedrawHTMLPart( const KURL& , bool ) ) );
@@ -177,7 +175,6 @@ void KitaHTMLPart::connectSignals()
     connect( signalCollection, SIGNAL( kitaIsActive() ), SLOT( slotKitaIsActive() ) );
     connect( signalCollection, SIGNAL( windowDeactivated() ), SLOT( slotHideChildPopup() ) );
 
-
     /* click */
     connect( this, SIGNAL( openURLRequestExt(
                                const KURL&, const KParts::URLArgs&, QString, int,
@@ -186,7 +183,6 @@ void KitaHTMLPart::connectSignals()
                                            const KURL& , const KParts::URLArgs&, QString, int,
                                            const KURL& ) ) );
 
-
     /* write dock */
     connect( this, SIGNAL( activateThreadView( const KURL& ) ),
              signalCollection, SIGNAL( activateThreadView( const KURL& ) ) );
@@ -592,9 +588,7 @@ QString KitaHTMLPart::getCurrentIDofNode()
 /* public slot */
 void KitaHTMLPart::slotClickGotoFooter()
 {
-    if ( !m_domtree
-            || m_mode != HTMLPART_MODE_MAINPART
-       ) {
+    if ( !m_domtree || m_mode != HTMLPART_MODE_MAINPART ) {
         gotoAnchor( "footer", FALSE );
         return ;
     }
@@ -662,7 +656,6 @@ bool KitaHTMLPart::findText( const QString &query, bool reverse )
 
             /* scroll & select & return */
             if ( m_findPos != -1 ) {
-
                 int matchLen = regexp.matchedLength();
 
                 QRect qr = m_findNode.getRect();
@@ -673,27 +666,23 @@ bool KitaHTMLPart::findText( const QString &query, bool reverse )
                 return TRUE;
             }
 
-        }
-
-        /*------------------------*/
-        else if ( m_findNode.nodeName().string() == "table" ) {
+        } else if ( m_findNode.nodeName().string() == "table" ) {
 
             QRect qr = m_findNode.getRect();
 
             m_find_y = qr.bottom();
-        }
 
-        /*------------------------*/
-        else if ( m_findNode.nodeName().string() == "div" ) {
+        } else if ( m_findNode.nodeName().string() == "div" ) {
 
             QRect qr = m_findNode.getRect();
 
-            if ( reverse ) m_find_y = qr.bottom();
-            else m_find_y = qr.top();
-        }
+            if ( reverse ) {
+                m_find_y = qr.bottom();
+            } else {
+                m_find_y = qr.top();
+            }
 
-        /*------------------------*/
-        else if ( m_findNode.nodeName().string() == "br" ) {
+        } else if ( m_findNode.nodeName().string() == "br" ) {
 
             DOM::Node tmpnode = m_findNode.previousSibling();
 
@@ -718,7 +707,9 @@ bool KitaHTMLPart::findText( const QString &query, bool reverse )
 
             while ( !m_findNode.isNull() && next.isNull() ) {
                 m_findNode = m_findNode.parentNode();
-                if ( !m_findNode.isNull() ) next = m_findNode.nextSibling();
+                if ( !m_findNode.isNull() ) {
+                    next = m_findNode.nextSibling();
+                }
             }
         }
         /* revearse */
@@ -729,7 +720,9 @@ bool KitaHTMLPart::findText( const QString &query, bool reverse )
 
             while ( !m_findNode.isNull() && next.isNull() ) {
                 m_findNode = m_findNode.parentNode();
-                if ( !m_findNode.isNull() ) next = m_findNode.previousSibling();
+                if ( !m_findNode.isNull() ) {
+                    next = m_findNode.previousSibling();
+                }
             }
         }
 
@@ -842,7 +835,6 @@ void KitaHTMLPart::showPopupMenu( const KURL& kurl )
             }
         }
 
-
         /* end */
         popupMenu->insertItem( i18n( "End" ), ID_End_Link );
     }
@@ -1101,14 +1093,20 @@ void KitaHTMLPart::clickAnchor( const KURL& urlin )
     if ( i != -1 ) {
         refNum = refstr.left( i ).toInt();
         refNum2 = refstr.mid( i + 1 ).toInt();
-        if ( refNum2 < refNum ) refNum2 = refNum;
-    } else refNum = refNum2 = refstr.toInt();
+        if ( refNum2 < refNum ) {
+            refNum2 = refNum;
+        }
+    } else {
+        refNum = refNum2 = refstr.toInt();
+    }
 
     if ( !refNum ) return ;
 
     if ( m_mode == HTMLPART_MODE_POPUP ) {
         emit openURLRequestExt( urlin );
-    } else gotoAnchor( QString().setNum( refNum ), TRUE );
+    } else {
+        gotoAnchor( QString().setNum( refNum ), TRUE );
+    }
 }
 
 
@@ -1352,29 +1350,29 @@ void KitaHTMLPart::showBePopupMenu( const QString& refstr )
             BEMENU_COPYURL,
             BEMENU_SHOWBROWSER
         };
-    
+
         QClipboard * clipboard = QApplication::clipboard();
-    
+
         popupMenu->insertItem( i18n( "copy URL" ), BEMENU_COPYURL );
         popupMenu->insertItem( i18n( "Open with Web Browser" ), BEMENU_SHOWBROWSER );
-    
+
         /*--------------------------------------*/
         /* show popup menu */
-    
+
         int ret = popupMenu->exec( QCursor::pos() );
         delete popupMenu;
         switch ( ret ) {
-    
+
         case BEMENU_COPYURL:
             /* copy */
             clipboard->setText( strURL, QClipboard::Clipboard );
             clipboard->setText( strURL, QClipboard::Selection );
             break;
-    
+
         case BEMENU_SHOWBROWSER:
             emit openURLRequestExt( strURL, KParts::URLArgs(), "text/html" );
             break;
-    
+
         default:
             break;
         }
@@ -1447,7 +1445,9 @@ bool KitaHTMLPart::startMultiPopup()
     if ( m_popup && m_popup->isVisible() ) {
         m_multiPopup = TRUE;
         m_popup->moveMouseAbove();
-    } else m_multiPopup = FALSE;
+    } else {
+        m_multiPopup = FALSE;
+    }
 
     return m_multiPopup;
 }
@@ -1456,22 +1456,24 @@ bool KitaHTMLPart::startMultiPopup()
 /* Is it multi-popup mode now ? */ /* private */
 bool KitaHTMLPart::isMultiPopupMode()
 {
-    if ( !m_popup ) m_multiPopup = FALSE;
-    else if ( m_popup->isHidden() ) m_multiPopup = FALSE;
+    if ( !m_popup ) {
+        m_multiPopup = FALSE;
+    } else if ( m_popup->isHidden() ) {
+        m_multiPopup = FALSE;
+    }
 
     return m_multiPopup;
 }
 
-
 /* private */
 void KitaHTMLPart::hidePopup()
 {
-    if ( m_popup ) m_popup->hide();
+    if ( m_popup ) {
+        m_popup->hide();
+    }
     m_multiPopup = FALSE;
 }
 
-
-
 /* return TRUE if this view is under mouse. */ /* private */
 bool KitaHTMLPart::isUnderMouse( int mrgwd, int mrght )
 {
@@ -1490,7 +1492,6 @@ bool KitaHTMLPart::isUnderMouse( int mrgwd, int mrght )
     return FALSE;
 }
 
-
 /* private slot */
 void KitaHTMLPart::slotLeave()
 {
@@ -1501,14 +1502,14 @@ void KitaHTMLPart::slotLeave()
     hidePopup();
 
     /* emit signal to have parent hide this if this is popup . */
-    if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) emit hideChildPopup();
+    if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) {
+        emit hideChildPopup();
+    }
 }
 
-
 /* private slot */
 void KitaHTMLPart::slotVSliderReleased()
 {
-
     QScrollBar * bar = view() ->verticalScrollBar();
     QRect rt = bar->sliderRect();
     int mrg = rt.right() - rt.left();
@@ -1516,14 +1517,15 @@ void KitaHTMLPart::slotVSliderReleased()
     hidePopup();
 
     /* emit signal to have parent hide this if this is popup . */
-    if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( mrg, 0 ) ) emit hideChildPopup();
+    if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( mrg, 0 ) ) {
+        emit hideChildPopup();
+    }
 }
 
 
 /* private slot */
 void KitaHTMLPart::slotHSliderReleased()
 {
-
     QScrollBar * bar = view() ->horizontalScrollBar();
     QRect rt = bar->sliderRect();
     int mrg = rt.bottom() - rt.top();
@@ -1531,7 +1533,9 @@ void KitaHTMLPart::slotHSliderReleased()
     hidePopup();
 
     /* emit signal to have parent hide this if this is popup . */
-    if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, mrg ) ) emit hideChildPopup();
+    if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, mrg ) ) {
+        emit hideChildPopup();
+    }
 }
 
 
@@ -1542,7 +1546,9 @@ void KitaHTMLPart::slotHideChildPopup()
     hidePopup();
 
     /* emit signal to have parent hide this if this is popup . */
-    if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) emit hideChildPopup();
+    if ( m_mode == HTMLPART_MODE_POPUP && !isUnderMouse( 0, 0 ) ) {
+        emit hideChildPopup();
+    }
 }
 
 
@@ -1586,8 +1592,11 @@ void KitaHTMLPart::slotOnURL( const QString& url )
     /* get reference */
     QString refstr;
     KURL datURL = m_datURL;
-    if ( url.at( 0 ) == '#' ) refstr = url.mid( 1 );
-    else datURL = Kita::getDatURL( KURL( m_datURL, url ) , refstr );
+    if ( url.at( 0 ) == '#' ) {
+        refstr = url.mid( 1 );
+    } else {
+        datURL = Kita::getDatURL( KURL( m_datURL, url ) , refstr );
+    }
 
     /*------------------------*/
     /* id popup               */
@@ -1595,8 +1604,11 @@ void KitaHTMLPart::slotOnURL( const QString& url )
     if ( url.left( 6 ) == "#idpop" ) {
         int num = Kita::DatManager::getNumByID( m_datURL, url.mid( 6 ) );
         QString tmpstr;
-        if ( num >= 2 ) tmpstr = QString( "<DIV>ID:%1:[%2]</DIV>" ).arg( url.mid( 6 ) ).arg( num );
-        else tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+        if ( num >= 2 ) {
+            tmpstr = QString( "<DIV>ID:%1:[%2]</DIV>" ).arg( url.mid( 6 ) ).arg( num );
+        } else {
+            tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+        }
         showPopup( m_datURL, tmpstr );
         return ;
     }
@@ -1610,8 +1622,11 @@ void KitaHTMLPart::slotOnURL( const QString& url )
         int num = 0;
         Kita::DatManager::getTreeByRes( m_datURL, no, num );
         QString tmpstr;
-        if ( num ) tmpstr = QString( "<DIV>No.%1 : [%2]</DIV>" ).arg( no ).arg( num );
-        else tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+        if ( num ) {
+            tmpstr = QString( "<DIV>No.%1 : [%2]</DIV>" ).arg( no ).arg( num );
+        } else {
+            tmpstr = "<DIV>" + i18n( "None" ) + "</DIV>";
+        }
         showPopup( m_datURL, tmpstr );
         return ;
     }
@@ -1701,12 +1716,3 @@ bool KitaHTMLPart::showSelectedDigitPopup()
 
     return FALSE;
 }
-
-
-
-
-/*--------------------------------------------------------------*/
-/*--------------------------------------------------------------*/
-/* class ResPopup */
-
-