Recently, with the rapid progress in all-optical networks and optical computing, there is an increasing requirement for more appropriate methods to design all-optical logic gates. Photonic crystals (PCs) can be serving as a versatile platform for manipulating light propagation. The realization of topological edge states (TESs) and topological corner states (TCSs) within high-order topological photonic insulators has attracted extensive attention. In this paper, TESs and TCSs are achieved using honeycomb photonic crystals (PCs) with square dielectric columns instead of conventional cylindrical ones for obtaining a larger photonic energy band gap due to reduction of dielectric column symmetry. TESs with overlapping frequencies can be attained by different arrangements of combining two PCs with distinct topological properties. A sandwich structure comprising both topologically trivial and non-trivial PCs is proposed, and "AND Gate" and "OR Gate" logic gates are implemented through the coupling between edge state waveguides when controlling the number of coupling layers. Additionally, a triangular-shaped box structure composed of non-trivial PCs enveloped by trivial PCs is constructed. Within this structure, TCSs manifest only around each acute angle, and a "NOT Gate" logic gate is realized through corner state coupling and edge state coupling. This work paves a new way of designing high-performance micro-nano all-optical logic gate devices.